简体   繁体   English

Django 1.7长期迁移永无止境

[英]Django 1.7 long migrations never ends

I'm using django 1.7 with a MySQL DB. 我正在将django 1.7与MySQL数据库一起使用。 I'm trying to run a migration that deletes a column from a table with 500K rows. 我正在尝试运行一个迁移,该迁移将从具有500K行的表中删除一列。 When running the migration it hangs for an infinite amount of time. 运行迁移时,它会挂起无限长的时间。

When manually connecting to the DB, I can see that the migration worked (the column has been deleted). 手动连接到数据库时,可以看到迁移有效(该列已删除)。 However the migration was not written to django_migrations table. 但是,迁移未写入django_migrations表。 When looking at DB performance graphs, I see the spike made by the migration, and then back to normal levels. 查看数据库性能图时,我看到了迁移带来的峰值,然后又恢复到正常水平。

What might be the cause for the hang? 死机的原因可能是什么? Am I missing something? 我想念什么吗?

Update : here is the migration code 更新 :这是迁移代码

class Migration(migrations.Migration):
    operations = [
        migrations.RemoveField(
            model_name='table_name',
            name='column_name',
        ),
    ]

this seems not to be the desired behavior. 这似乎不是期望的行为。 Please point this to the Django-users mailing list: https://groups.google.com/forum/#!forum/django-users 请将此指向Django用户的邮件列表: https ://groups.google.com/forum/#!forum/django-users

Or open a ticket at: https://code.djangoproject.com/query 或在以下位置打开票证: https : //code.djangoproject.com/query

Django 1.7 is freshly released and I know that the migrations are one of the most complicated changes they've made in this release. Django 1.7是新发布的,我知道migrations是他们在此版本中所做的最复杂的更改之一。

Sorry that I can't help you immediately. 对不起,我不能立即为您服务。

Cheers 干杯

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM