Say I have a model Doctor that has a Many to Many relationship to AppointmentType.
AppointmentType could be ‘Online’,‘Face to Face’,‘Telephone’
I would model this with a ‘through’ table e.g Doctor → DoctorByAppointmentType → AppointmentType.
In my migrations I would add some RunPython that would populate AppointmentType with the above three values.
If I wanted to add a new value say ‘Email’ I will then have to create a new migration file and write the logic to insert the new value.
My thoughts here are that it would be really useful to have a migrations file that was run idempotently every deployment that could take care of use cases like these(reference tables).
I’m also asking the question to see how other people may handle this kind of scenario and if creating a manual migration is the best way to handle this scenario?
Thanks
Chris