使用新的“--freeze”的正确方法是什么? django-south 的 startmigration 选项?

发布于 2024-07-24 04:23:38 字数 203 浏览 2 评论 0原文

我已经尝试过以下操作,但这似乎只创建一个空的迁移文件:

startmigration appname freeze_appname --freeze appname

我也尝试过:

startmigration --freeze appname

也不起作用。

I've tried the following but this seems to only create an empty migration file:

startmigration appname freeze_appname --freeze appname

i've also tried just:

startmigration --freeze appname

doesn't work either.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

软的没边 2024-07-31 04:23:39

好吧,因为我周围没有南方用户,所以我必须弄清楚如何做到这一点。

我做错的是首先创建数据迁移而不冻结

我这样做的应用程序:

startmigration appname migrate_data

这创建了空白迁移文件,然后我在其中放入了数据迁移函数。 但我没有冻结我想在迁移过程中使用/访问的应用程序,

正确的方法是:

startmigration appname migrate_data --freeze apptouseinmigration

Ok since i see no SOUTH users around, i had to figure out how to do this.

what i did wrong was create the data migrations first without freezing the apps

i did this:

startmigration appname migrate_data

and this created the blank migrations file where i then put in my data migration functions. but i did not freeze the apps i wanted to use/access withing the migration

the right way to do this would have been:

startmigration appname migrate_data --freeze apptouseinmigration
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文