summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--application/migrations/021_change_charset.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/application/migrations/021_change_charset.php b/application/migrations/021_change_charset.php
index 20a8ce7f7..475732ed5 100644
--- a/application/migrations/021_change_charset.php
+++ b/application/migrations/021_change_charset.php
@@ -11,10 +11,11 @@ class Migration_change_charset extends CI_Migration {
# nothing to do
} else {
$this->db->query('SET FOREIGN_KEY_CHECKS = 0');
- foreach (['actions', 'apikeys', 'files', 'file_storage', 'multipaste', 'multipaste_file_map', 'profiles', 'users'] as $table) {
- $this->db->query('
- ALTER TABLE `'.$prefix.$table.'` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
- ');
+ foreach ([
+ ['apikeys', 'comment', 'VARCHAR(255)'],
+ ['files', 'filename', 'VARCHAR(256)'],
+ ] as $col) {
+ $this->db->query('ALTER TABLE `'.$prefix.$col[0].'` CHANGE `'.$col[1].'` `'.$col[1].'` '.$col[2].' CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;');
}
$this->db->query('SET FOREIGN_KEY_CHECKS = 1');
}