Schema #114
Replies: 1 comment 7 replies
-
Below is my proposal for the data schema. It gives a lot of flexibility for the notification system to be used for a large variety of purposes. I totally understand it's a departure from the previous schema. I believe for how powerful this system could be and how often it will be queried, it has to be structured in a very performant way. It will be looked up on every page load of the admin area, and from what @erikyo has described to me the goal is to poll the the database through the JSON API. Database SchemaKey features
PossibilitiesCreate a messaging system for users inside of WordPress. It could give collaborators the ability to have message threads for a specific posts and/or workflows. This seems like a powerful feature, possibly an even a more important use case than plugin notifications. Message schemaMessages data is stored separately from channel data and can be linked to many users through the wp_notify_messages table
Channel schemaCore should have a set registered channels. Plugins can register channels of their own. wp_ notify_channels table
IdeasMaybe even user registered channels. Every user has a channel attached to directly to their profile. Allows for notifications targeted to a single user. How would that be discoverable? An entry in the Message QueueJoin table used to map messages to specific users. Could periodically be cleared depending on message The full history of messages for every user is retained and could be easily looked up. If a message has been orphan it can safely be deleted. wp_notify_queue table
SubscriptionsJoin table used determine for whom to enqueue messages for a specific channel. Logic to authorize a users to subscribe to a channel would be based on a comparison of the wp_ notify_subscriptions
|
Beta Was this translation helpful? Give feedback.
-
Current project schema for notifications is as follow:
https://github.com/WordPress/wp-feature-notifications/blob/develop/docs/database-schema.md
Database Schema
wp_notifications table
ID of the notification.
Sender of the notification. As defined by the plugin or theme
Timestamp of when the notification was triggered.
Single notification recipient. As defined by the plugin or theme
Notification title key. As defined by the plugin or theme
Notification message key. As defined by the plugin or theme
(optional)Correctly formatted URL to an internal or external action.
Notification status.
We also have updated demo schema in #98
Beta Was this translation helpful? Give feedback.
All reactions