Add Lake model

This commit is contained in:
Backend IM Bot 2025-03-26 06:54:18 -05:00
parent 68fd238279
commit 6d84741c09

14
models/lake.py Normal file
View File

@ -0,0 +1,14 @@
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())