-
Notifications
You must be signed in to change notification settings - Fork 439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create notification table #9360
Conversation
eecde66
to
855bac0
Compare
h/models/notification.py
Outdated
REPLY = "reply" | ||
|
||
|
||
class Notification(Base, Timestamps): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory we could add send
column on top of what we get from Timestamp
but it's probably okay.
h/models/notification.py
Outdated
"""FK to user.id""" | ||
user: Mapped[User] = relationship(back_populates="notifications", uselist=False) | ||
|
||
type: Mapped[NotificationType] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bare bones version for now to support mention edits.
We will probably add status
and actor_id
(triggered by) in later phases.
33041c1
to
a5764a4
Compare
a5764a4
to
ebfc2fe
Compare
index=True, | ||
) | ||
"""FK to annotation.id - the annotation that triggered this notification""" | ||
source_annotation = relationship( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed this after discussion in slack
index=True, | ||
) | ||
"""FK to user.id - the user receiving the notification""" | ||
recipient = relationship("User", uselist=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And renamed this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
We might have to tweak the structure when we make decision about how notifications will work in-app vs the immediate need to support edits, but that's fine.
Refs #9359
This adds notification table to the app models together with its sql migration
Testing
admin@example.com
/mail
directory for incoming emails