class WishlistModel(db.Model): __tablename__ = 'Mywhislist' id = db.Column(db.Integer, primary_key=True) product_id = db.Column(db.Integer, db.ForeignKey('product.id'), nullable=False) user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)
class CartModel(db.Model): __tablename__ = 'cart' id = db.Column(db.Integer, primary_key=True) quantity = db.Column(db.Integer, nullable=False) total_cost = db.Column(db.Integer, nullable=False) user_id = db.Column(db.Integer, db.ForeignKey('user.id')) product_id = db.column(db.Integer, db.ForeignKey('product.id'))
class CommentDetail(db.Model): __tablename__ = 'comment_user' id = db.Column(db.Integer,primary_key=True) product_id = db.Column(db.Integer,db.ForeignKey('product.id'),nullable=False) comment_id = db.Column(db.Integer, db.ForeignKey('comments.id'), unique=True, nullable=False) upvote = db.Column(db.Integer,nullable=True) downvote=db.Column(db.Integer,nullable=True)
class Orders(db.Model): id = db.Column(db.Integer, primary_key=True) user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False) paid = db.Column(db.Boolean, nullable=False) payment_id = db.Column(db.Integer, db.ForeignKey('payment.id'), unique=True, nullable=False)
class OrderDetail(db.Model): _tablename__ = 'order_detail' id = db.Column(db.Integer, primary_key=True) order_id = db.Column(db.Integer, db.ForeignKey('orders.id')) product_id = db.Column(db.Integer, db.ForeignKey('product.id')) quantity = db.Column(db.Integer, nullable=False) amount = db.Column(db.Integer, nullable=False) ship_address = db.Column(db.String(100), nullable=False)
class Comments(db.Model): __tablename__='comments' id = db.Column(db.Integer, primary_key=True) comment=db.Column(db.String(255),nullable=False) upvote = db.Column(db.Integer,nullable=True) downvote=db.Column(db.Integer,nullable=True) user_id = db.Column(db.Integer,db.ForeignKey('user.id')) product_id=db.Column(db.Integer,db.ForeignKey('product.id'))
class CartDetail(db.Model): __tablename__ = 'cart_detail' id = db.Column(db.Integer, primary_key=True) cart_id = db.Column(db.Integer, db.ForeignKey('cart.id'), nullable=False) product_id = db.Column(db.Integer, db.ForeignKey('product.id'), nullable=False) quantity = db.Column(db.Integer, nullable=False) amount = db.Column(db.Float, nullable=False)
class OrderModel(db.Model): __tablename__ = 'order' id = db.Column(db.Integer, primary_key=True) amount = db.Column(db.Integer, nullable=False) shipment = db.Column(db.String(100), nullable=False) ship_Address = db.Column(db.String(100), nullable=False) user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
class UserAddress(db.Model): id = db.Column(db.Integer, primary_key=True) address = db.Column(db.String(250), nullable=False) user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False, Unique=True)
class Cart(db.Model): __tablename__ = 'cart' id = db.Column(db.Integer, primary_key=True) user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
class Productmeta(db.Model): id = db.Column(db.Integer, primary_key=True) image_path = db.Column(db.String(100), nullable=False) product_id = db.Column(db.Integer, db.ForeignKey('product.id'))
class PaymentModel(db.Model): __tablename__ = 'payment' id = db.Column(db.Integer, primary_key=True) payment_type = db.Column(db.String(200), nullable=False) amount = db.Column(db.Integer, nullable=False) user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
class Product(db.Model): __tablename__ = 'product' id = db.Column(db.Integer, primary_key=True) product_name = db.Column(db.String(100), nullable=False) product_price = db.Column(db.Float, nullable=False) product_category_id = db.Column(db.Integer, db.ForeignKey('category.id'))
class WhislistModel(db.model): __tablename__ = 'Mywhislist' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(100), nullable=False) user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
class OrderProduct(db.Model): _tablename__ = 'orderproduct' id = db.Column(db.Integer, primary_key=True) order_id = db.Column(db.Integer, db.ForeignKey('order.id')) product_id = db.Column(db.Integer, db.ForeignKey('product.id'))
class TreePath(db.Model): __tablename__ = 'Treepath' id = db.Column(db.Integer, primary_key=True) ancestor = db.Column(db.Integer, db.ForeignKey('category.id')) descendants = db.Column(db.Integer, db.ForeignKey('category.id'))