Add Shoe model
This commit is contained in:
parent
14aaf2085f
commit
f53205d672
22
models/shoe.py
Normal file
22
models/shoe.py
Normal file
@ -0,0 +1,22 @@
|
||||
from sqlalchemy import Column, String, Integer, DateTime, ForeignKey
|
||||
from sqlalchemy.orm import relationship
|
||||
from sqlalchemy.sql import func
|
||||
from core.database import Base
|
||||
import uuid
|
||||
|
||||
class Shoe(Base):
|
||||
__tablename__ = "shoes"
|
||||
|
||||
id = Column(String, primary_key=True, default=lambda: str(uuid.uuid4()))
|
||||
name = Column(String, nullable=False, index=True)
|
||||
brand = Column(String, nullable=False)
|
||||
size = Column(Integer, nullable=False)
|
||||
color = Column(String, nullable=False)
|
||||
style = Column(String)
|
||||
condition = Column(String)
|
||||
purchase_date = Column(DateTime)
|
||||
price = Column(Integer)
|
||||
notes = Column(String)
|
||||
|
||||
created_at = Column(DateTime, default=func.now())
|
||||
updated_at = Column(DateTime, default=func.now(), onupdate=func.now())
|
Loading…
x
Reference in New Issue
Block a user