This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import time
|
||||
from enum import Enum as Enumeration
|
||||
|
||||
from sqlalchemy import JSON as JSONType
|
||||
from sqlalchemy import JSON as JSONType, func, cast
|
||||
from sqlalchemy import Column, Enum, ForeignKey, Integer
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
@@ -34,7 +33,7 @@ class NotificationSeen(Base):
|
||||
class Notification(Base):
|
||||
__tablename__ = "notification"
|
||||
|
||||
created_at = Column(Integer, default=lambda: int(time.time()))
|
||||
created_at = Column(Integer, server_default=cast(func.current_timestamp(), Integer))
|
||||
entity = Column(Enum(NotificationEntity), nullable=False)
|
||||
action = Column(Enum(NotificationAction), nullable=False)
|
||||
payload = Column(JSONType, nullable=True)
|
||||
|
Reference in New Issue
Block a user