15 lines
478 B
Python
15 lines
478 B
Python
from datetime import datetime
|
|
from sqlalchemy import Column, Integer, String, DateTime, Boolean
|
|
|
|
from app.models.base import Base
|
|
|
|
|
|
class Message(Base):
|
|
__tablename__ = "messages"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
sender = Column(String, nullable=False)
|
|
recipient = Column(String, nullable=False)
|
|
content = Column(String, nullable=False)
|
|
timestamp = Column(DateTime, default=datetime.utcnow)
|
|
is_read = Column(Boolean, default=False) |