class ShoppingCart(db.Model): __tablename__ = 'ShoppingCart' c_id = db.Column(db.Integer, db.ForeignKey('Customer.c_id'), primary_key=True) product_id = db.Column(db.Integer, db.ForeignKey('Product.product_id'), primary_key=True) quantity = db.Column(db.Integer, nullable=False) db.UniqueConstraint('product_id')
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 Stock(db.Model): __tablename__ = 'Stock' warehouse_id = db.Column(db.Integer, primary_key=True) product_id = db.Column(db.Integer, db.ForeignKey('Product.product_id'), primary_key=True) quantity = db.Column(db.Integer, nullable=False)
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 Food(db.Model): __tablename__ = 'Food' product_id = db.Column(db.Integer, db.ForeignKey('Product.product_id'), primary_key=True) food_category = db.Column(db.String(20), nullable=False) calories = db.Column(db.Integer, nullable=False)
class CreditCard(db.Model): __tablename__ = 'CreditCard' state = db.Column(db.String(20), nullable=False) zipcode = db.Column(db.String(20), nullable=False) street = db.Column(db.String(40), nullable=False) city = db.Column(db.String(20), nullable=False) cardnumber = db.Column(db.String(20), nullable=False, primary_key=True) c_id = db.Column(db.Integer, db.ForeignKey('Customer.c_id'))
class Shipping_Address(db.Model): __tablename__ = 'Shipping_Address' address_id = db.Column(db.Integer, primary_key=True, autoincrement=True) zipcode = db.Column(db.Integer, primary_key=True) state = db.Column(db.String(20), primary_key=True) street = db.Column(db.String(40), primary_key=True) city = db.Column(db.String(20), nullable=False) customer_id = db.Column(db.Integer, db.ForeignKey('Customer.c_id'))