Category "django-migrations"

Django: Renaming Models, M2M Table not renamed

TLDR: Models moved to a new app. After migrating M2M relation refers to table that does not exist. Previous M2M table was not renamed. Django Version: 3.2.3 Sce

django permissions: new permission is inserted after all other migrations

I added a new permission to my model, and than used manage.py makemigrations. it created a migration that alters the model options (specificly the permisions..)

Django change an existing field to foreign key

I used to have a model like this: class Car(models.Model): manufacturer_id = models.IntegerField() There is another model Manufacturer that the id field re

django.db.migrations.exceptions.NodeNotFoundError while upgrading django

I am upgrading my django project from django1.5 to django1.11.10. while upgrading when I run ./manange.py migrate I am getting django.db.migrations.exceptions.N

Default value for foreign key in Django migrations.AddField

Using migrations, I need to add a new field (a foreign key) to a model. I know it can be done with: migrations.AddField( model_name='MyModel',

Django Programming error column does not exist even after running migrations

I run python manage.py makemigrations and I get: No changes detected Then, python manage.py migrate and I get: No migrations to apply. Then, I try to p