What is the best way to migrate data in django

前端 未结 6 1270
渐次进展
渐次进展 2021-01-30 11:27

After making some changes in my models (eg. new field in a model and a new model) what is the best way of reflecting these changes to my populated database?


PS: I

6条回答
  •  [愿得一人]
    2021-01-30 11:45

    Look with manage.py sqlall what the parameters are for the new columns and manually add them in your database with Alter table statements. This way you don't have to redo your database; It requires some SQL knowledge though...

    Take a look here (Scroll down to "Making Changes to a Database Schema")

提交回复
热议问题