class Cost(db.Model): __tablename__ = 'Cost' product_id = db.Column(db.Integer, db.ForeignKey('Product.product_id'), primary_key=True) state = db.Column(db.String(20), nullable=False, primary_key=True) price = db.Column(db.Numeric(8, 2))
class Alcohol(db.Model): __tablename__ = 'Alcohol' product_id = db.Column(db.Integer, db.ForeignKey('Product.product_id'), primary_key=True) alcohol_category = db.Column(db.String(20), nullable=False) alcohol_content = db.Column(db.Numeric(3, 1))
class Order(db.Model): __tablename__ = 'Order' order_id = db.Column(db.Integer, primary_key=True, unique=True) subtotal = db.Column(db.Numeric(8, 2), nullable=False) card_number = db.Column(db.String(20), nullable=False) time_ordered = db.Column(db.DateTime, nullable=False, default=datetime.utcnow) status = db.Column(db.String(20), nullable=False)
class Staff(db.Model): __tablename__ = 'Staff' s_username = db.Column(db.String(20), primary_key=True) first_name = db.Column(db.String(20), nullable=False) last_name = db.Column(db.String(20), nullable=False) job_title = db.Column(db.String(20), nullable=False) password = db.Column(db.String(20), nullable=False) salary = db.Column(db.Numeric(8, 2)) state = db.Column(db.String(20), nullable=False) street = db.Column(db.String(40), nullable=False) city = db.Column(db.String(20), nullable=False) zipcode = db.Column(db.Integer, nullable=False)
class Staff(db.Model, UserMixin): __tablename__ = 'Staff' s_id = db.Column(db.Integer, primary_key=True) s_username = db.Column(db.String(20)) first_name = db.Column(db.String(20), nullable=False) last_name = db.Column(db.String(20), nullable=False) job_title = db.Column(db.String(20), nullable=False) password = db.Column(db.String(20), nullable=False) salary = db.Column(db.Numeric(8, 2)) state = db.Column(db.String(20), nullable=False) street = db.Column(db.String(40), nullable=False) city = db.Column(db.String(20), nullable=False) zipcode = db.Column(db.Integer, nullable=False) def get_id(self): return (self.s_id)