We have three different types (user, article, comment) a user can subscribe to. Each type has a separate table. I want the user to be able to subscribe to another user, article or comment.
Subscription table columns:
id(integer, AI)
type('String, can be 'article', 'comment', 'user')
ref('integer', indicates the index key to an external table)
user_id('integer', foreign key to the users table)
So this row would be a user with id=101 who is subscribed to a comment with id 99
1 | comment | 99 | 101
user with id=101 is also subscribed to article with id=88
1 | article | 88 | 101
You get the idea. Is this a good design?