【问题标题】:MigrationSchemaMissing(Unable to create the django_migrations table (%s) % exc)MigrationSchemaMissing(无法创建 django_migrations 表(%s)% exc)
【发布时间】:2016-08-10 01:41:01
【问题描述】:

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

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

【问题讨论】:

    标签: django postgresql migration


    【解决方案1】:

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

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

    【讨论】:

    • 在我为 username=djangouser 运行这个之后,我得到了django.db.utils.ProgrammingError: permission denied for relation django_migrations
    • 我在.freemysqlhosting.net 使用主机mysql 并在phpmyadmin.co 中运行grant usage on schema public to username; grant create on schema public to username;,但是两个命令没有执行。请帮帮我。
    猜你喜欢
    • 2018-09-12
    • 2018-11-21
    • 2022-10-03
    • 2018-07-13
    • 2018-06-23
    • 2022-11-03
    • 2021-04-04
    • 2018-10-14
    • 1970-01-01
    相关资源
    最近更新 更多