Updating django application, migrations

时间:2015-07-28 17:15:16

标签: python django migration django-south

Is it possible to remove schemamigrations from the Queue? For example. When I run the command ./manage.py migrate --list, it returns a list of all migrations including items that have yet to be migrated.

I have 5 items that have not been migrated yet, but I do not want to migrate 2 of them because I know they will throw an error.

Is is possible to remove those migrations from the 'queue' so to speak?

Thanks!

2 个答案:

答案 0 :(得分:1)

yourapp/migrations删除相应的文件。调用

后存储了所有文件
python manage.py makemigrations

这些文件的名称类似于0001_initial.py

如果没有文件,调用

时没有任何反应
python manage.py migrate

模型准备就绪后,您可以为数据库创建新的迁移。

答案 1 :(得分:0)

运行migrate时,应使用--fake选项将这些迁移标记为已应用。