Django South - 如何在Django应用程序上重置迁移历史记录并开始清理

时间:2022-12-19 19:15:47

This seems to be outdated as the reset command does not seem to be found using the version of South I am using, which is the most recent I believe.

这似乎已经过时,因为使用我正在使用的南方版本似乎找不到重置命令,这是我认为的最新版本。

Anyways, say you are in production and things get really messy. What is the best current way to start fresh with a Django app as far as cleaning up the migration history?

无论如何,说你正在制作,事情变得非常混乱。在清理迁移历史记录的过程中,使用Django应用程序开始新鲜的最佳方式是什么?

1 个解决方案

#1


13  

Steps:

脚步:

  1. Erase every /migrations folder inside your apps
  2. 清除应用内的每个/迁移文件夹
  3. Go to the database and drop the south_migrationhistory table (or delete its rows)
  4. 转到数据库并删除south_migrationhistory表(或删除其行)
  5. (Optional) Remove south from your installed apps (if you want to get rid of south, if not, leave it alone)
  6. (可选)从已安装的应用程序中删除南方(如果您想要摆脱南方,如果没有,请不要管它)

Done

完成

Notice that you may drop the table or delete all its rows.

请注意,您可以删除表或删除其所有行。

If you drop it you'll have to syncdb again.

如果你删除它,你将不得不再次syncdb。

Hope this helps!

希望这可以帮助!

#1


13  

Steps:

脚步:

  1. Erase every /migrations folder inside your apps
  2. 清除应用内的每个/迁移文件夹
  3. Go to the database and drop the south_migrationhistory table (or delete its rows)
  4. 转到数据库并删除south_migrationhistory表(或删除其行)
  5. (Optional) Remove south from your installed apps (if you want to get rid of south, if not, leave it alone)
  6. (可选)从已安装的应用程序中删除南方(如果您想要摆脱南方,如果没有,请不要管它)

Done

完成

Notice that you may drop the table or delete all its rows.

请注意,您可以删除表或删除其所有行。

If you drop it you'll have to syncdb again.

如果你删除它,你将不得不再次syncdb。

Hope this helps!

希望这可以帮助!