mysql - Django South 字段改长度后出错:FATAL ERROR
大家讲道理
大家讲道理 2017-04-17 11:20:07
0
1
518

在django中的一个WEELesson model 中的 desc字段,原来是200的长度,后来我觉得长了,就把max_length改成了100,原来Mysql中已有三四要记录了,使用South生成了新的Model修改文件,然后使用./manage.py migrate weelesson修改数据库时,就出现了现面的错误:

第一次遇到这情况,实在没搞懂怎么回事,麻烦大家帮帮看看。

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(1)
PHPzhong

I tried to reproduce the error.
When South discovered that there was data with a length greater than 100 in the desc field during the merge, it would prompt:
django.db.utils.DataError: (1265, "Data truncated for column 'XXX' at row X")

Actually, the following at row X has pointed out which record is too long, you just need to modify it yourself.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!