Add ServerTime model

This commit is contained in:
Backend IM Bot 2025-03-26 16:12:50 +00:00
parent f6ed3de911
commit f79e29368b

13
models/servertime.py Normal file
View File

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