【问题标题】:How to get Django South to migrate a field with changed max_length?如何让 Django South 迁移更改 max_length 的字段?
【发布时间】:2013-04-19 07:45:47
【问题描述】:

我想要增加max_length 属性的模型中有一个CharField。 South 没有注意到这种变化,说没有什么可以迁移的。我如何让它迁移这个?

【问题讨论】:

  • 你使用的是什么数据库后端?
  • 您先运行schemamigration my_app --auto 了吗?这会产生新的迁移。 migrate 然后应用它们。

标签: python django django-south


【解决方案1】:

发出命令(代码中max_length更改后):

python manage.py schemamigration <name of the app> --auto
python manage.py migrate <name of the app>

这对我有用。 希望对你有帮助

【讨论】:

  • 呃,忘了进行架构迁移,并愚蠢地认为它与 max_length 有关。谢谢。本来打算删除这个问题,但有人投了赞成票,所以也许它对其他人有用。
猜你喜欢
  • 2014-05-01
  • 1970-01-01
  • 1970-01-01
  • 2015-04-27
  • 1970-01-01
  • 1970-01-01
  • 2013-02-13
  • 2012-05-19
  • 2012-08-06
相关资源
最近更新 更多