25 lines
879 B
Python
Executable File
25 lines
879 B
Python
Executable File
from sqlalchemy import Column, Integer, String, Enum
|
|
from app.db.base import Base
|
|
import enum
|
|
|
|
# Enum definiálása
|
|
class LocationType(str, enum.Enum):
|
|
stop = "stop" # Megálló / Parkoló
|
|
warehouse = "warehouse" # Raktár
|
|
client = "client" # Ügyfél címe
|
|
|
|
class Location(Base):
|
|
__tablename__ = "locations"
|
|
__table_args__ = {"schema": "data"}
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
name = Column(String, nullable=False)
|
|
|
|
# FONTOS: Itt is megadjuk a schema="data"-t, hogy ne a public sémába akarja írni!
|
|
type = Column(Enum(LocationType, schema="data", name="location_type_enum"), nullable=False)
|
|
|
|
# Koordináták (egyelőre String, később PostGIS)
|
|
coordinates = Column(String, nullable=True)
|
|
address_full = Column(String, nullable=True)
|
|
|
|
capacity = Column(Integer, nullable=True) |