Category "django-migrations"

Django constraints when removing columns in manual migrations

Django silently removes constraints when removing columns, then arbitrarily chooses to include them in migrations. I've encountered an odd bug(?) in Django in o

error in migration with legacy database in Django

I'm working on creating a filter in django where the options displayed are coming from a new column in the database. It turns out that this column was created d

Getting Django migration error "sequence must have same owner as table it is linked to", but all tables and sequences have the same owner

I'm trying to run a migration in a Django project. (Django 3.1, Python 3.9.9) I'm in my virtual environment. I keep getting a puzzling error. python manage.py

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