Add Message model

This commit is contained in:
Backend IM Bot 2025-03-26 02:54:22 +00:00
parent 805b949e9c
commit 988118aa6e

11
models/message.py Normal file
View File

@ -0,0 +1,11 @@
from sqlalchemy import Column, String, DateTime
from sqlalchemy.sql import func
from core.database import Base
import uuid
class Message(Base):
__tablename__ = "messages"
id = Column(String, primary_key=True, default=lambda: str(uuid.uuid4()))
message = Column(String, default="yooo", nullable=False)
created_at = Column(DateTime, default=func.now())
updated_at = Column(DateTime, default=func.now(), onupdate=func.now())