12 lines
417 B
Python
12 lines
417 B
Python
from sqlalchemy import Column, Integer, String, Float, Text
|
|
|
|
from app.db.models.base import Base
|
|
|
|
|
|
class Product(Base):
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
name = Column(String, index=True, nullable=False)
|
|
description = Column(Text, nullable=True)
|
|
price = Column(Float, nullable=False)
|
|
stock = Column(Integer, nullable=False, default=0)
|
|
image_url = Column(String, nullable=True) |