#34879: "Data truncated for column .." for migration changing auto-id-field
-------------------------------+--------------------------------------
Reporter: Wolfgang Fehr | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 3.2
Severity: Normal | Resolution: worksforme
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):
* status: new => closed
* resolution: => worksforme
Comment:
Thanks for the report, however it works for me:
{{{#!sql
python manage.py sqlmigrate test_34879 0002
--
-- Alter field id on somemodel
--
ALTER TABLE `test_34879_somemodel` DROP FOREIGN KEY
`test_34879_somemodel_some_self_foreignkey_466fbd54_fk_test_3487`;
ALTER TABLE `test_34879_somemodel` MODIFY `id` bigint AUTO_INCREMENT NOT
NULL;
ALTER TABLE `test_34879_somemodel` MODIFY `some_self_foreignkey_id` bigint
NULL;
ALTER TABLE `test_34879_somemodel` ADD CONSTRAINT
`test_34879_somemodel_some_self_foreignkey_id_466fbd54_fk` FOREIGN KEY
(`some_self_foreignkey_id`) REFERENCES `test_34879_somemodel` (`id`);
}}}
Moreover Django 3.2 is in extended support and doesn't receive bugfixes
anymore (except security patches), and support for MySQL < 8 was dropped
in Django 4.2.
There is a known issue with `ManyToManyField`, so maybe you've encountered
it (check out #32674).
--
Ticket URL: <https://code.djangoproject.com/ticket/34879#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018adb415b68-688a31c0-5bec-4f96-9785-30bc6fe15a71-000000%40eu-central-1.amazonses.com.