本文介绍了MigrationSchemaMissing(无法创建 django_migrations 表(%s)% exc)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做的步骤:1. 删除迁移文件.2.只创建了一个初始迁移文件.3. 进入 psql 命令提示符.连接到数据库.删除模式公共级联;创建公共架构;4.再次尝试迁移.

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.

我得到 MigrationSchemaMissing(Unable to create the django_migrations table (%s) % exc) 错误.

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

推荐答案

这个 answer 及其问题的评论有效对我来说,简而言之,您必须获得以下架构所需的授权:

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;

这篇关于MigrationSchemaMissing(无法创建 django_migrations 表(%s)% exc)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 10:39