1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fix altering of SERIAL columns and InnoDB being picky about FK changes

This commit is contained in:
Andrew Godwin
2013-12-11 14:19:05 +00:00
parent cee4fe7307
commit 5db028affb
5 changed files with 173 additions and 17 deletions

View File

@@ -636,6 +636,7 @@ class SchemaTests(TransactionTestCase):
# Alter to change the PK
new_field = SlugField(primary_key=True)
new_field.set_attributes_from_name("slug")
new_field.model = Tag
with connection.schema_editor() as editor:
editor.remove_field(Tag, Tag._meta.get_field_by_name("id")[0])
editor.alter_field(