Add Alcohol model
This commit is contained in:
parent
20fd710db7
commit
d1098c83a0
14
models/alcohol.py
Normal file
14
models/alcohol.py
Normal file
@ -0,0 +1,14 @@
|
||||
from sqlalchemy import Column, String, Integer, DateTime, func
|
||||
from sqlalchemy.dialects.postgresql import UUID
|
||||
from core.database import Base
|
||||
import uuid
|
||||
|
||||
class Alcohol(Base):
|
||||
__tablename__ = "alcohols"
|
||||
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
||||
name = Column(String, nullable=False, unique=True)
|
||||
brand = Column(String, nullable=False)
|
||||
alcohol_type = Column(String, nullable=False)
|
||||
alcohol_content = Column(Integer, nullable=False)
|
||||
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