Squashing multiple South migrations into one migration

后端 未结 3 1014
慢半拍i
慢半拍i 2021-02-10 14:09

During development I created many migrations, often going back and forth about how I wanted to implement something.

Now it is time to push it to production, but I am get

3条回答
  •  一生所求
    2021-02-10 15:02

    There is a command in the django manage.py specifically for this. If you are using Migrations as fixtures you might need to fiddle with the dependencies attribute in some of the Migrations if you don't wish to squash your fixtures.

    If you have no fixtures and simply want to squash all the migrations from you can run:

    python manage.py squashmigrations app_name 0001
    

    Where app_name is the name of your app, and 0001 is the migration you wish to squash up to.

    See the docs linked above for more information.

提交回复
热议问题