0

I am getting this error when trying to make migrations. Migration test_1.0001_initial is applied before its dependency test_2.0016_boolean on database 'default'. I've tried python manage.py makemigrations --merge I have also tried. python manage.py migrate --fake

2 Answers2

0

is this your production server? if not then try deleting all migration files and dropping migration table and re running makemigration cmd like this Django 'migration is applied before its dependency' when running any migration commands. when testing or developing that's how I always went around this error. but if your app is hosted or it is a production server then try these ways Django manage.py: Migration applied before its dependency
Also check out this answer https://stackoverflow.com/a/59884520/8363401 where author has explained the cause of these kinds of errors.

0

First check whether there is any pending migrations using

python manage.py showmigrations

if you found any pending migrations try normal migrations command if it doesn't works try the fake

python manage.py migrate --fake <your_app_name> <the_migration_name>

this could fix the issue I guess, if not then try deleting your migraions folder and DB then try again