A
A
Alexander2020-04-21 13:51:38
PostgreSQL
Alexander, 2020-04-21 13:51:38

Django does not migrate how to fix?

Good afternoon, I can’t migrate on the project, I execute python manage.py migrate and I get an error:

django.db.utils.ProgrammingError: permission denied for schema public
LINE 1: CREATE TABLE "accounts_countjobstag" ("id" serial NOT NULL P...

I googled the error myself, found similar errors, tried to give privileges to the user:
psql mydatabase -c "GRANT ALL ON ALL TABLES IN SCHEMA public to dbuser;"
psql mydatabase -c "GRANT ALL ON ALL SEQUENCES IN SCHEMA public to dbuser;"
psql mydatabase -c "GRANT ALL ON ALL FUNCTIONS IN SCHEMA public to dbuser;"

But everything repeats, I don’t understand why there are not enough rights to create a table when the database was created by the user under which we work in django.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melkij, 2020-04-21
@AlexMine

permission denied for schema public

Someone explicitly made This right is default for the public scheme, it was someone or something who deliberately revoked it. corresponding grant
revoke create on schema public from public;
grant create on schema public to username

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question