I added a new ImageField in my models.py:
class User(AbstractUser):
[more_fields_here]
profile_picture = models.ImageField(upload_to='profile_pictures', null=True)
I ran python manage.py makemigrations and then python manage.py migrate without any errors.
But when I run my application I am getting:
ProgrammingError at column authentication_user.profile_picture does not exist
I checked in the Postgres database and the column profile_picture does not exist.
I deleted the migrations and tried again, but I am still getting the same error.
In the migrations/0001_initial.py there is the line:
('profile_picture', models.ImageField(null=True, upload_to='profile_pictures')),
But why does the column not exist in the table?
0001_initialis already migrated and this is why it doesn't add this field. I'd also suggest to trypython manage.py migrate appname zeroto rollback all migrations and then runpython manage.py migrateagain.AUTH_USER_MODELto your custom user model? Are you seeing the[more_fields_here]fields in the database?AUTH_USER_MODEL. All other fields are in the database as expected. The problem is only with this field.manage.py sqlmigrate <app_name> 0001include SQL to create the column?