Get one comment table to serve both apps and posts table?
I've created a table called comments, comments has a property called ItemId which is used as the foreign key for two other tables posts and apps.
This is because i was hoping for the comments table to serve both the apps and posts table. However when trying to insert a value into the comments table开发者_如何转开发 it throws a foreign key constraint error.
Does anyone know the best way of accomplishing what I'm trying to do with the least amount of duplication?
See this question/answer.
精彩评论