17 lines
543 B
Python
17 lines
543 B
Python
from sqlalchemy import Column, Integer, String, Boolean, Float
|
|
from sqlalchemy.orm import relationship
|
|
from database import Base
|
|
|
|
|
|
class Table(Base):
|
|
__tablename__ = "tables"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
number = Column(Integer, unique=True, nullable=False)
|
|
label = Column(String, nullable=True)
|
|
is_active = Column(Boolean, default=True, nullable=False)
|
|
floor_x = Column(Float, nullable=True)
|
|
floor_y = Column(Float, nullable=True)
|
|
|
|
orders = relationship("Order", back_populates="table")
|