📜  删除迁移 django 并重新开始部署 heroku - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:44.426000             🧑  作者: Mango

代码示例1
#If you still have the old code running on Heroku:

#1) Back your database up

#2) Reverse all of your migrations:

$ heroku run python manage.py migrate appname zero

#3) Then deploy your new code:

$ git push heroku master
#4) Then run the new migrations:

$ heroku run python manage.py migrate


#If you've already deployed the new code to Heroku:

#1) Back your database up

#2) Manually delete your app's tables from your database, as well as rows from the django_migrations table where the app matches your app name e.g. via heroku pg:psql (this may get tricky if you have other apps installed and inter-app dependencies)

#3) Run your new migrations:

$ heroku run python migrate