Any idea why I would be getting this error when I try to migrate?
django.db.utils.ProgrammingError: relation "django_content_type"
I am using using Django 1.8 & PostgreSql
Any idea why I would be getting this error when I try to migrate?
django.db.utils.ProgrammingError: relation "django_content_type"
I am using using Django 1.8 & PostgreSql
@Josh's solution worked for me with the following changes. Prior to step 1, I re-added the missing column:
ALTER TABLE django_content_type ADD COLUMN name character varying(50) NOT NULL DEFAULT 'run migrate.py';
Running python manage.py migrate auth
removes this column, presumabley making one or more other changes that failed on some earlier run of migrate
.
When running migrate
in step 3 I included the --fake-initial
flag:
python manage.py migrate --fake-initial
Everything seems to be set right again.
I, like many, don't really understand the problem. I was able to devise a solution that worked for me.
./manage.py migrate auth
./manage.py migrate
./manage.py migrate
.Good luck!
You're going to need to use the
--fake-initial
option when you migrate; it used to be implicit, but has now been made explicit:https://docs.djangoproject.com/en/1.8/ref/django-admin/#django-admin-option---fake-initial
To quote:
Good luck!