-
Notifications
You must be signed in to change notification settings - Fork 19
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
docs: notification database schema #168
docs: notification database schema #168
Conversation
0c66a7e
to
ea94bd6
Compare
Some ideas for core WordPress channels
The final message render could be hookable, and filters applied to it. This would provide the hook function with the data about the user and the notification, allowing personalized messages. |
The properties missing from the original, mostly because I didn't understand the translation aspect,
|
ea94bd6
to
3f0e344
Compare
What should the character limit for the translation |
Hmm I don't think this needs to be massive, since the message key is essentially namespaced by the sender key. I'll have a look at WP Core and see if something else does exist that would be helpful 🤔 |
@JasonTheAdams Does this look like a good start? I made it in MySQL Workbench. I looked at the option you linked in Slack, but it looked like it was only for paid subscription (I could be wrong, just didn't research further). |
@Sephsekla it would be nice to have find some resolution to Issue #219 (even if the solution is a half measure to support implementing a functional API to experiment with). At the moment I haven't found a performant way to looking up the translations by key/slug. Edit: To enable implementing features while we consider the translation system, we will store messages in the database in the translated language at time a notification is emitted. Though with a strong understanding it will need further consideration and most like require modifications. |
This updated V2 schema makes adjustments based on Issue #209 and PR #251. Notifications are to be translated at the time of emission and stored this way in the notifications table. The subscription table is removed, in preference for in code channel registration and discovery. Subscriptions are linked to registered channels by the Considerations
|
3f0e344
to
3ddb65a
Compare
2ef593a
to
c55fd20
Compare
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.
LGTM!
What?
Redesigns the database schema in markdown.
Why?
Improve the notification system to be fast and flexible.
Continues Discussion #114
Issues with the previous schema
recipient
, which could be either a role or users email, limits the system to messages targeting only a single user or a role. If more possibilities are added, it will only continue to complicate the query to find a users messages and enlarge the database index. The more flexible the system the slower it becomes.status
of a single users message if therecipient
is a role. Toggling thestatus
would change the state of the notification for every user of that role. To maintain a status of every user in a single table would require duplicating the message for every user.How?
This PR does not implement the schema, it is for documentation and planning.