I'd like to change a ForeignKey field into a ManyToManyField, preserving existing data by creating entries in the many-to-many through table. Running makemigrations after changing the model class creates a migration that executes a RemoveField on the existing ForeignKey field and then an AddField on the new ManyToManyField, which destroys any existing ForeignKey data.
I ended up implementing this by creating three migrations:
1. schema migration: create the new ManyToManyField
2. data migration: copy existing ForeignKey data into the ManyToManyField
3. schema migration: remove the ForeignKey field and rename the ManyToManyField
Is there a simpler way to do this type of schema change?