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

2

7

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.

Reckoning answered 18/4, 2016 at 10:53 Comment(0)
G
10

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;
Goodspeed answered 21/4, 2016 at 10:46 Comment(2)
After I ran this for username=djangouser I'm getting django.db.utils.ProgrammingError: permission denied for relation django_migrationsRosalindrosalinda
I use host mysql at .freemysqlhosting.net and run grant usage on schema public to username; grant create on schema public to username; in phpmyadmin.co, but two commands not execute. Please help me.Piperidine
A
-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

Articulator answered 3/3, 2023 at 13:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.