This design is inspired from these two designs:
The sender will be the one who is Responsible for the notification.
- User as a Sender
- A user responsible for sending the notification the the receiveres, will have the
ID_SENDERin the"NOTIFICATIONS"Table.
- A user responsible for sending the notification the the receiveres, will have the
- System as a Sender
- Useful for something like a reminder notification.
- Since a system doesn't have an
ID, if theID_SENDERis null, it should be understood that it is aSystem as a Sender.
- The one that will receive the notification.
- will have the
ID_RECEIVERin the"NOTIFICATIONS"Table.
This will describe what kind of entity that notification is.
We should have a different table for this called NOTIFICATION_ENTITIES with a column NAME which should be named like this TASK, WORKSPACE, TASK_DUE_REMINDER, This should be descriptive.
The entity type should only be limited to CREATE,READ,UPDATE,DELETE
which is the basic CRUD.
INSERT a new Notification Entity in the NOTIFICATON_ENTITIES Table.
INSERT INTO "NOTIFICATION_ENTITIES" (name)
VALUES ('TASK');Now the notification should look like this .

"Sender" "Created" a "Task" at "TimeStamp".
INSERT a new Notification Entity in the NOTIFICATON_ENTITIES Table.
INSERT INTO "NOTIFICATION_ENTITIES" (name)
VALUES ('TASK_DUE_REMINDER');Now the notification table should look like this .

"Sender" - null so it is a System's Notification
"Created" a "TASK_DUE_REMINDER" at "TimeStamp".
