I'm installing a 3rd party app, but needed to rename one of my apps as the names clashed. As part of this renaming I needed to write a migration to update django_content_type
and django_migrations
tables.
The trouble is when the migrations run, the 3rd party app migrations run before mine. How can I force mine in to run before the 3rd party apps?
Current migration code:
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('my_cms', '0003_promotedsearch_title_it'),
]
operations = [
migrations.RunSQL(
'UPDATE django_content_type SET app_label=\'my_cms\' '
'WHERE app_label=\'cms\';'
),
migrations.RunSQL(
'UPDATE django_migrations SET app=\'my_cms\' WHERE app=\'cms\';'
),
]
thanks