14 lines
565 B
Python
14 lines
565 B
Python
from sqlalchemy import Column, String, Float, DateTime
|
|
from sqlalchemy.sql import func
|
|
from core.database import Base
|
|
import uuid
|
|
|
|
class Lake(Base):
|
|
__tablename__ = "lakes"
|
|
id = Column(String, primary_key=True, default=lambda: str(uuid.uuid4()))
|
|
name = Column(String, nullable=False, index=True)
|
|
area = Column(Float, nullable=False)
|
|
depth = Column(Float, nullable=False)
|
|
location = Column(String, nullable=False)
|
|
created_at = Column(DateTime, default=func.now())
|
|
updated_at = Column(DateTime, default=func.now(), onupdate=func.now()) |