I have a table of exercises. I want to be able to create a workout in my react app and then submit it to the database. but I'm struggling to think how the schema would work. how can I achieve this?
I essentially want a workout to be an array of exercises. But I am aware storing arrays in databases isn't the best idea
But I can't understand how if I had a table of exercises and then a table of workouts, how I can join them together to make a table where I have a list of workouts with exercises
I want to be able to pull out a unique workout and that will give me the list of exercises from that workout along with a date and other info.
The only way I can picture it is like:
id: 1, name: 'my first workout', exercises: [array of objects]
Any ideas how this schema would look?