Renaming User model to Profile: Migration error
Opened this issue · 0 comments
I renamed the User model to Profile and generally 'user' in all files to 'profile', in order to use the Django User model with a one-to-one link to my custom Profile model, instead of having my own User model.
I also renamed the VirtualUser model to VirtualProfile.
makemigrations worked, but migrate failed with the following error:
django.db.migrations.exceptions.InvalidBasesError: Cannot resolve bases for [<ModelState: 'core.Person'>, <ModelState: 'core.VirtualProfile'>]
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/1.10/topics/migrations/#dependencies for more
I tried to modify the migration file (0055) to rename only VirtualUser at first. This worked, but the same error occured when I ran makemigrations and migrate to migrate the rest.
I googled and found some examples of this error, but I couldn't understand the replies.