Django迁移到新数据库 [英] Django Migrating to a new Database
问题描述
致命错误 - 以下SQL查询失败:ALTER TABLEaccounts_account ADD CONSTRAINTlogo_id_refs_file_ptr_id_7c3d1997FOREIGN KEY(logo_id)参考filer_image(file_ptr_id)DEFERRABLE INITIALLY DEFERRED;
错误是:关系filer_image不存在
我不知道什么问题可能是,显然在创建生产数据库或后续的迁移中没有问题。
我相信我已经正确安装了sorl-thumbnail及其所有的依赖项
您的帮助将会非常apperciated。
将Johndt6提供的答案从未来的搜索能力的这个答案中拉出来。
解决方案是添加 filer
到 INSTALLED_APPS
元组。
I just joined a project using Django, and am attempting to initialize my own development server. When I attempt to do so, the migration fails for one of my apps. A model for this app has a sorl.thumbnail.ImageField, to add a logo. When the migration is attempted, I get the following error message:
FATAL ERROR - The following SQL query failed: ALTER TABLE "accounts_account" ADD CONSTRAINT "logo_id_refs_file_ptr_id_7c3d1997" FOREIGN KEY ("logo_id") REFERENCES "filer_image" ("file_ptr_id") DEFERRABLE INITIALLY DEFERRED;
The error was: relation "filer_image" does not exist
I'm not sure what the problem could be, as apparently there was no problem in creating the production database or subsequent migrations.
I believe I have correctly installed sorl-thumbnail, and all of its dependencies.
Your help would be much apperciated.
I'm pulling the answer provided by Johndt6 from a comment to this answer for future search-ability.
The solution is to add filer
to the INSTALLED_APPS
tuple.
这篇关于Django迁移到新数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!