Add School model
This commit is contained in:
parent
d56fafabcf
commit
33fe3ab7f5
21
models/school.py
Normal file
21
models/school.py
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
from sqlalchemy import Column, String, Integer, Boolean, DateTime, ForeignKey
|
||||||
|
from sqlalchemy.orm import relationship
|
||||||
|
from sqlalchemy.sql import func
|
||||||
|
from core.database import Base
|
||||||
|
import uuid
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
|
class School(Base):
|
||||||
|
__tablename__ = "schools"
|
||||||
|
id = Column(String, primary_key=True, default=lambda: str(uuid.uuid4()))
|
||||||
|
name = Column(String, nullable=False, index=True)
|
||||||
|
address = Column(String, nullable=False)
|
||||||
|
capacity = Column(Integer, nullable=False)
|
||||||
|
storage_type = Column(String, nullable=False)
|
||||||
|
temperature_controlled = Column(Boolean, default=False)
|
||||||
|
security_level = Column(String, nullable=False)
|
||||||
|
is_active = Column(Boolean, default=True)
|
||||||
|
square_footage = Column(Integer, nullable=False)
|
||||||
|
available_space = 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