【发布时间】:2018-12-06 16:25:54
【问题描述】:
构建:Heroku Python 服务器、Postgresql 10.4、Django 2、wagtail 2.1
我试图在 Heroku 上彻底销毁并重新创建我的应用程序数据库。以下是我遵循的步骤:
- 创建数据库转储(成功)
- rm 所有迁移并重新创建“初始”迁移(成功)
- 运行`heroku pg:reset DATABASE`(成功)
- 推送新的迁移和数据库转储(成功)
- 运行`heroku run python manage.py migrate`(成功)
- 运行`heroku run python manage.py flush`(**失败**)
JVsquad$ heroku run python manage.py flush
Running python manage.py flush on ⬢ my_app... up, run.2459 (Hobby)
You have requested a flush of the database.
This will IRREVERSIBLY DESTROY all data currently in the 'my_app_db' database,
and return each table to an empty state.
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: yes
CommandError: Database my_app_db couldn't be flushed. Possible
reasons:
* The database isn't running or isn't configured correctly.
* At least one of the expected database tables doesn't exist.
* The SQL was invalid.
Hint: Look at the output of 'django-admin sqlflush'. That's the SQL this command wasn't able to run.
我的第 7 步将是 heroku run python manage.py loaddata db_dump.json,但它也失败了,因为刷新不起作用。
请帮忙
【问题讨论】:
-
django-admin sqlflush的输出是什么
标签: django postgresql heroku