13 lines
526 B
Python
13 lines
526 B
Python
from sqlalchemy import Column, String, DateTime
|
|
from sqlalchemy.sql import func
|
|
from core.database import Base
|
|
import uuid
|
|
|
|
class ServerTime(Base):
|
|
__tablename__ = "server_times"
|
|
|
|
id = Column(String, primary_key=True, default=lambda: str(uuid.uuid4()))
|
|
current_time = Column(DateTime, default=func.now(), nullable=False)
|
|
timezone = Column(String, nullable=False, default='UTC')
|
|
created_at = Column(DateTime, default=func.now())
|
|
updated_at = Column(DateTime, default=func.now(), onupdate=func.now()) |