Browse Source

#1054 Convert all field from utf8 to utf8mb4: script to print ready SQL queries

Alex Trofimov 8 years ago
parent
commit
74ea7c2d38
1 changed files with 3 additions and 1 deletions
  1. 3 1
      scripts/change_collation_sql.php

+ 3 - 1
scripts/change_collation_sql.php

@@ -54,7 +54,9 @@ class BxDolChangeCOllationSqlCmd
                 $s .= "ALTER TABLE `$sTable` CHANGE `{$r['Field']}` `{$r['Field']}` {$r['Type']} CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;\n";
             }
 
-            $s .= "\n\n";
+            $s .= "\n";
+            $s .= "REPAIR TABLE `$sTable`;\n";
+            $s .= "OPTIMIZE TABLE `$sTable`;\n\n\n";
         }
 
         $this->finish(0, $s);