From 1dd114bc7479fc970c7ac6d4ce2ef8de87b90d52 Mon Sep 17 00:00:00 2001 From: Raymond Yee Date: Wed, 15 Oct 2014 07:46:50 -0700 Subject: [PATCH] add to migration the change in default collation for core_identifier. One possible problem is that this code is mysql specific. In practice, not a problem for now since we're using mysql. --- core/migrations/0065_auto__chg_field_identifier_value.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/migrations/0065_auto__chg_field_identifier_value.py b/core/migrations/0065_auto__chg_field_identifier_value.py index f01f4fcf..3a0ef2c2 100644 --- a/core/migrations/0065_auto__chg_field_identifier_value.py +++ b/core/migrations/0065_auto__chg_field_identifier_value.py @@ -9,6 +9,8 @@ class Migration(SchemaMigration): def forwards(self, orm): + # change default collation + db.execute('ALTER TABLE core_identifier DEFAULT character set utf8 collate utf8_bin;') # Changing field 'Identifier.value' db.alter_column('core_identifier', 'value', self.gf('django.db.models.fields.CharField')(max_length=250)) @@ -16,6 +18,9 @@ class Migration(SchemaMigration): # Changing field 'Identifier.value' db.alter_column('core_identifier', 'value', self.gf('django.db.models.fields.CharField')(max_length=31)) + + # remove default collation for table + db.execute('ALTER TABLE core_identifier DEFAULT character set utf8;') models = { 'auth.group': {