[英]django.db.utils.ProgrammingError: relation “auth_user” does not exist - django 2.0.2
I've tried all of the solutions from the top results for this question on Google; 我已经在Google上针对此问题尝试了所有最佳结果的解决方案; none of them work for my situation:
他们都不适合我的情况:
doing python manage.py migrate auth
before `python manage.py migrate didn't work (same error) 在`python manage.py migration之前做
python manage.py migrate auth
不起作用(相同错误)
changing all references to 'auth.User' in my models to AUTH_USER_MODEL didn't work (same error), and neither did get_user_model() ( makemigrations
detected no changes anyway) 将我模型中对“ auth.User”的所有引用都更改为AUTH_USER_MODEL不起作用(相同的错误),get_user_model()也没有(
makemigrations
未检测到任何更改)
doing python manage.py makemigrations [app_with_user_relation]
did not work either (migrations were made, but still got the same error) 做
python manage.py makemigrations [app_with_user_relation]
也不起作用(进行了迁移,但仍然遇到相同的错误)
have deleted and recreated the database multiple times 已多次删除并重新创建数据库
Does anyone have any new suggestions? 有人有什么新建议吗?
I hear downgrading to Django 1.7 might work, but that is not an option for me. 我听说降级到Django 1.7可能有效,但这不是我的选择。
If anyone is curious, the app I am trying to migrate is powerdns
, from the open source package django-powerdns-manager. 如果有人好奇,我尝试迁移的应用程序是
powerdns
,来自开源软件包django-powerdns-manager。
Full traceback: https://dpaste.de/JdT5 完整回溯: https : //dpaste.de/JdT5
The failing migration: https://dpaste.de/rfUn 迁移失败: https : //dpaste.de/rfUn
Custom db router: https://github.com/mike-johnson-jr/django-powerdns-manager/blob/master/src/powerdns_manager/routers.py 自定义数据库路由器: https : //github.com/mike-johnson-jr/django-powerdns-manager/blob/master/src/powerdns_manager/routers.py
Custom database router routes migrations with app label "auth" to my default database rather than my powerdns database. 定制数据库路由器将带有应用标签“ auth”的迁移路由到我的默认数据库,而不是我的powerdns数据库。 Because of this, powerdns is making a foreignkey reference to another database, which is not possible in neither postgresql nor mysql, only sqlite.
因此,powerdns正在对另一个数据库进行外键引用,而在postgresql和mysql中,只有sqlite是不可能的。 In mysql, error will be "cannot create foreign key constraint"
在mysql中,错误将为“无法创建外键约束”
You can solve this error by only using 1 database or using sqlite for both. 您可以仅使用1个数据库或同时使用sqlite来解决此错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.