Reputation: 6874
I am creating a social media site. Users can create a category (1 user to many categories) and each category has many entries. I want to allow users to post on events (1 event can have many posts).
In other words the event owns the post but I want to be able to identify the user who created that post.
Does this mean that I should create 1 event to many posts as well as 1 user to many posts? Does this create normalization problems. What's the best way around this?
Upvotes: 0
Views: 71
Reputation: 48177
I dont see any relation between category and events
In that case add a categoryID as FK in Events
Users table
Primary key
Categories table
Primary key
Foreign Key (users)
Events
Primary key
Posts
Primary key
Foreign Key (events)
Foreign Key (users)
Upvotes: 2