0
I’m working on the construction of my TCC and a problem has arisen. I have a schedule table, and this table needs to store some data, among them, the activities that will be spent during the year. Because of this, I created the activities table, but then I get a problem: a schedule can have several activities, how can I store more than one activity in this schedule?? The value is undefined, a schedule can have up to 47 activities, and I would like to add them dynamically to the schedule. That is, the activities table should borrow more than one key at a time in the schedule table, how to do this??
Hello friend, but in this case, the creation of a schedule depends on the existence of activities. How would I set the foreign key of a schedule in an activity, being that still technically does not exist the schedule, since the table activities register first?
– Gabriel Almeida
This logic is strange. A schedule has
n
activities, not the other way around. You create a schedule and then create the activities by tying them to this schedule."– juniorgarcia