Django migrations.exceptions.InvalidBasesError (in production)
I run a script with Docker in localhost, there is no problem but when I try to run it in a server, I always get the invalidbase migration error when I run the setup.sh
which starts with:
python manage.py makemigrations
python manage.py migrate
...
django.db.migrations.exceptions.InvalidBasesError: Cannot resolve bases for [<ModelState: 'project1.MetaFlatPage'>]
This can happen if you are inheriting models from an app with migrations (e.g. contrib.auth)
in an app with no migrations; see https://docs.djangoproject.com/en/3.2/topics/migrations/#dependencies for more
I run docker compose run web python manage.py makemigrations
and output is: "PostgreSQL is up. No changes detected"
then run docker compose run web python manage.py makemigrations
got the same error above.
There are two different docker yml files; dev and production and they are slightly different. I don't know if this relevant but I can share those files too.