2023-08-06 20:01:40 +00:00
|
|
|
from datetime import datetime
|
|
|
|
from sqlalchemy import Column, String, JSON, ForeignKey, DateTime, Boolean
|
2023-10-05 18:46:18 +00:00
|
|
|
from services.db import Base
|
2021-08-19 10:02:28 +00:00
|
|
|
|
2022-09-03 10:50:14 +00:00
|
|
|
|
2021-08-19 10:02:28 +00:00
|
|
|
class Notification(Base):
|
2022-09-03 10:50:14 +00:00
|
|
|
__tablename__ = "notification"
|
2021-08-19 10:02:28 +00:00
|
|
|
|
2023-08-06 20:01:40 +00:00
|
|
|
user = Column(ForeignKey("user.id"), index=True)
|
|
|
|
createdAt = Column(DateTime, nullable=False, default=datetime.now, index=True)
|
|
|
|
seen = Column(Boolean, nullable=False, default=False, index=True)
|
|
|
|
type = Column(String, nullable=False)
|
|
|
|
data = Column(JSON, nullable=True)
|