Vipul Vishnu av
Vipul Vishnu av

Reputation: 526

MigrationSchemaMissing(Unable to create the django_migrations table (%s) % exc)

Steps I did: 1. Deleted migration files. 2.created only one initial migration file. 3. Enter psql command prompt. Connect to database. drop schema public cascade; create schema public; 4.tried to migrate again.

I get MigrationSchemaMissing(Unable to create the django_migrations table (%s) % exc) Error.

Upvotes: 7

Views: 12060

Answers (2)

saurav
saurav

Reputation: 1

I simply deleted the database and recreated and then ran the migration again to solve this problem.

DROP DATABASE database_name

% python manage.py migrate

Upvotes: -3

motam
motam

Reputation: 747

This answer and the comment on its question works for me, in brief you must get required grant for a schema as below:

grant usage on schema public to username;
grant create on schema public to username;

Upvotes: 10

Related Questions