]> www.vanbest.org Git - tweet-django-debian/commitdiff
Fix database character set: utf8mb4 to allow emoji in tweet texts v1.2
authorJan-Pascal van Best <janpascal@vanbest.org>
Mon, 22 Feb 2016 19:29:05 +0000 (20:29 +0100)
committerJan-Pascal van Best <janpascal@vanbest.org>
Mon, 22 Feb 2016 19:29:05 +0000 (20:29 +0100)
tweet/migrations/0011_change_database_charset.py [new file with mode: 0644]

diff --git a/tweet/migrations/0011_change_database_charset.py b/tweet/migrations/0011_change_database_charset.py
new file mode 100644 (file)
index 0000000..a32031e
--- /dev/null
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.utils.timezone
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('tweet', '0010_auto_20160220_2130'),
+    ]
+
+    operations = [
+        migrations.RunSQL("ALTER DATABASE DEFAULT CHARACTER SET utf8mb4"),
+        migrations.RunSQL("ALTER TABLE tweet CHARACTER SET utf8mb4"),
+        migrations.RunSQL("ALTER TABLE tweet MODIFY text LONGTEXT CHARACTER SET utf8mb4")
+    ]
+
+