Make notification data column a string
This commit is contained in:
parent
dc18c86057
commit
8000087896
|
@ -1,5 +1,5 @@
|
||||||
from datetime import UTC, datetime
|
from datetime import UTC, datetime
|
||||||
from typing import Annotated, Any, ClassVar, Literal, final
|
from typing import Annotated, ClassVar, Literal, final
|
||||||
|
|
||||||
from beanie import Document, Indexed
|
from beanie import Document, Indexed
|
||||||
from pydantic import Field
|
from pydantic import Field
|
||||||
|
@ -15,7 +15,7 @@ class Notification(Document):
|
||||||
user: Annotated[BeanieLink[User], Indexed()]
|
user: Annotated[BeanieLink[User], Indexed()]
|
||||||
event_type: Annotated[Literal["reminder", "invitation"], Indexed()]
|
event_type: Annotated[Literal["reminder", "invitation"], Indexed()]
|
||||||
message: str
|
message: str
|
||||||
data: Any
|
data: str
|
||||||
read: bool
|
read: bool
|
||||||
created_at: datetime = Field(default_factory=lambda: datetime.now(UTC))
|
created_at: datetime = Field(default_factory=lambda: datetime.now(UTC))
|
||||||
read_at: datetime | None = None
|
read_at: datetime | None = None
|
||||||
|
|
Loading…
Reference in a new issue