Django 1.7长迁移永远不会结束 [英] Django 1.7 long migrations never ends

查看:144
本文介绍了Django 1.7长迁移永远不会结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用django 1.7与MySQL数据库。我正在尝试运行一个从500K行的表中删除列的迁移。当运行迁移时,它挂起了无限的时间。



当手动连接到数据库时,我可以看到迁移有效(列已被删除)。但迁移未写入 django_migrations 表。当查看DB性能图表时,我看到迁移所产生的尖峰,然后恢复到正常水平。



挂起的原因可能是什么?我是否缺少某些东西?



更新:这里是迁移代码

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


解决方案

https://groups.google。 com / forum /#!forum / django-users



或打开一张票: https://code.djangoproject.com/query



Django 1.7是刚刚发布,我知道 migrations 是这个版本中最复杂的变化之一。



对不起,我马上不能帮你。



干杯


I'm using django 1.7 with a MySQL DB. I'm trying to run a migration that deletes a column from a table with 500K rows. 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. 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

Or open a ticket at: 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.

Sorry that I can't help you immediately.

Cheers

这篇关于Django 1.7长迁移永远不会结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆