Add City model
This commit is contained in:
parent
1e7f5cb4ab
commit
d6c4cb8aa4
14
models/city.py
Normal file
14
models/city.py
Normal file
@ -0,0 +1,14 @@
|
||||
from sqlalchemy import Column, String, DateTime, Boolean
|
||||
from sqlalchemy.sql import func
|
||||
from core.database import Base
|
||||
import uuid
|
||||
|
||||
class City(Base):
|
||||
__tablename__ = "cities"
|
||||
id = Column(String, primary_key=True, default=lambda: str(uuid.uuid4()))
|
||||
name = Column(String, nullable=False, index=True)
|
||||
endpoint = Column(String, nullable=False)
|
||||
description = Column(String)
|
||||
is_active = Column(Boolean, default=True)
|
||||
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