Web Developer
I wonder how to model something like this:
A user can create any amount of events.
Each event belongs to one user.
What I have done so far:
Created a new tables called 'users' and 'events'.
When a user signs up, a new entry in 'users' is created with its id from the built-in auth table. This column is called 'userId'.
However, when trying to set relationship to the 'events' table, the relationship is created via the 'user' table rowId. I cannot specify a key unfortunately.
How did you solve this?
Later, I want to do something in an admin dashboard: Get all events from user xyz