Add migration to convert tables to UTF-8
- convert all tables to utf8mb4 charset - convert all tables to InnoDB - set collation for all tables to utf8mb4_unicode_ci
This commit is contained in:
parent
77464ecee4
commit
32bc919530
1 changed files with 41 additions and 0 deletions
41
cats/migrations/0002_convert_to_utf8_and_innodb.py
Normal file
41
cats/migrations/0002_convert_to_utf8_and_innodb.py
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
# Generated by Django 4.2.16 on 2024-09-18 15:01
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
("cats", "0001_models_created_by_inspectdb"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RunSQL("ALTER TABLE answers ENGINE=InnoDB"),
|
||||||
|
migrations.RunSQL("ALTER TABLE answers CONVERT TO CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci"),
|
||||||
|
migrations.RunSQL("ALTER TABLE answers_incorrect ENGINE=InnoDB"),
|
||||||
|
migrations.RunSQL("ALTER TABLE answers_incorrect CONVERT TO CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci"),
|
||||||
|
migrations.RunSQL("ALTER TABLE learnprogress ENGINE=InnoDB"),
|
||||||
|
migrations.RunSQL("ALTER TABLE learnprogress CONVERT TO CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci"),
|
||||||
|
migrations.RunSQL("ALTER TABLE question_description ENGINE=InnoDB"),
|
||||||
|
migrations.RunSQL("ALTER TABLE question_description CONVERT TO CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci"),
|
||||||
|
migrations.RunSQL("ALTER TABLE questions ENGINE=InnoDB"),
|
||||||
|
migrations.RunSQL("ALTER TABLE questions CONVERT TO CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci"),
|
||||||
|
migrations.RunSQL("ALTER TABLE questiontype ENGINE=InnoDB"),
|
||||||
|
migrations.RunSQL("ALTER TABLE questiontype CONVERT TO CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci"),
|
||||||
|
migrations.RunSQL("ALTER TABLE questiontype_v2 ENGINE=InnoDB"),
|
||||||
|
migrations.RunSQL("ALTER TABLE questiontype_v2 CONVERT TO CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci"),
|
||||||
|
migrations.RunSQL("ALTER TABLE schema_version ENGINE=InnoDB"),
|
||||||
|
migrations.RunSQL("ALTER TABLE schema_version CONVERT TO CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci"),
|
||||||
|
migrations.RunSQL("ALTER TABLE statistics ENGINE=InnoDB"),
|
||||||
|
migrations.RunSQL("ALTER TABLE statistics CONVERT TO CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci"),
|
||||||
|
migrations.RunSQL("ALTER TABLE temp ENGINE=InnoDB"),
|
||||||
|
migrations.RunSQL("ALTER TABLE temp CONVERT TO CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci"),
|
||||||
|
migrations.RunSQL("ALTER TABLE topics ENGINE=InnoDB"),
|
||||||
|
migrations.RunSQL("ALTER TABLE topics CONVERT TO CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci"),
|
||||||
|
migrations.RunSQL("ALTER TABLE topic_type ENGINE=InnoDB"),
|
||||||
|
migrations.RunSQL("ALTER TABLE topic_type CONVERT TO CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci"),
|
||||||
|
migrations.RunSQL("ALTER TABLE user ENGINE=InnoDB"),
|
||||||
|
migrations.RunSQL("ALTER TABLE user CONVERT TO CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci"),
|
||||||
|
migrations.RunSQL("ALTER TABLE user_address ENGINE=InnoDB"),
|
||||||
|
migrations.RunSQL("ALTER TABLE user_address CONVERT TO CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci"),
|
||||||
|
]
|
Loading…
Reference in a new issue