0

I am trying to implement the notification for my website catering information from 3 different user. The three users triggers different events.

I have tried to implement it by having two tables

Notification_Type(table name)

  1. notificationType_id(int,notnull,autoincrement)
  2. name(varchar)
  3. heading(varchar)
  4. origin_table(varchar)

Notification_Detail(table name)

  1. notification_id(int,notnull,autoincrement)
  2. notificationtype_id(int)
  3. generated_by(varchar,45)
  4. origin(int)
  5. generated_for(int)
  6. generated_on(timestamp)

The problem i am facing is this schema is unable to cater information for a group of user to which the notification is related to. Also i am unable to figure-out how to implement read/unread.

Now the notification reach for different event is different according to the event. i.e When a user post something in the group the notification should be for all the members. But some one comment on the post it should notify on the user who owns the post.

Please Help me with this. Thanks

Ankit Sahu
  • 85
  • 4
  • 17
  • look here http://stackoverflow.com/questions/15013713/database-schema-for-notification-system-similar-to-facebooks – Backs Aug 10 '16 at 11:02
  • i have seen this schema already but i am unable to find the answer, how to manage the notification reach distinguish according to the level of events as i explained. – Ankit Sahu Aug 10 '16 at 11:06

1 Answers1

2

you can add 2 columns in Notification_Detail table

  • related_group_id (int) Null FK
  • read (bit) ( 0 as default )
  • I have tried implementing the way you are explaining, but i am again facing the problem when notification is for a dynamic subset of the group. which means group inside the group. – Ankit Sahu Aug 10 '16 at 15:25
  • 1
    no problem you have subset group_id, set it to related_group_id and with this id you can get all notification for related subset groups or its main group by using recurrence script. if you have only 2 level of groups then there is another way you can add 1 column to Notification_Detail related_sub_group_id Null FK for only related sub group – Ahmed Hosny Aug 14 '16 at 06:19