I have a Django project that uses a South application to handle schema and data migration. In one of my applications, I have a migration (number 0004), which is responsible for loading data from a json file:
class Migration(DataMigration): def forwards(self, orm): from django.core.management import call_command call_command("loaddata", "dummy_data.json")
In the same project, I am trying to add "soft delete" functionality, which requires the addition of another entry, defined as:
deleted_at = models.DateTimeField(blank=True, null=True)
Based on this change, I added a new migration, which has the number 0009. After that, I run the migrate command, which gives me an error:
DatabaseError: Problem installing fixture 'C:/Users/Grzegorz/PycharmProjects/Dummy Project/Dummy\app_subapp\fixtures\dummy_data.json': Could not load app_subapp.DummyData(pk=1): (1054, "Unknown column 'deleted_at' in 'field list'")
This is rather strange, because this error occurs when applying the 0004 migration, which previously worked fine and from the Southern process point at this step, registered by deleted_at , should not and does not exist in my database. I found that moving the migration with the boot device from step 0004 after 0009 solves the problem, but it looks very dirty and not very suitable for solving this problem.
Do you have any tips on how I can solve this problem and handle migrations and sub-bindings correctly?