I'm currently developing an online android application for information spreading for groups, which consists of several table,, Now I've created all the tables except one last table, notification table..
I want to create this notification table which is referring to multiple table, every time new activity has been committed, it will automatically stored the data on the notification table, and I want to combine all the primary key needed to create a notification from another table to one column (To avoid null column)
For example, I want to create an announcement in one group, the announcementId will be inserted to SourceId, and the groupId will be inserted in ReceiverId in NotificationTable, another example is if a user is being invited to join a group, it will store the groupId as SourceId and Invited Member as ReceiverId.
But I figured out recently that one column (as foreign key) can't referring to multiple column in multiple tables (SourceId, and ReceiverId can't refer to many tables)..
I read this article Phone database design, and I don't know how to make it, I can't make my SourceId and ReceiverId referring from multiple tables, is it any better way for me to solve this problem?
Ps : Sadly I don't have enough reputation to post my ERD picture, here is my ERD