handle table charsets

This commit is contained in:
mattbucci
2024-01-08 05:08:57 +00:00
parent 53125aec2d
commit a90ab01a9b
2 changed files with 33 additions and 1 deletions
+7 -1
View File
@@ -30,6 +30,7 @@ class CreateTableSQLRewriter extends AbstractSQLRewriter
' COLLATE utf8mb4_unicode_520_ci' => '',
' COLLATE utf8_general_ci' => '',
' CHARACTER SET utf8' => '',
' DEFAULT CHARSET=utf8' => '',
// For flash-album-gallery plugin
' tinyint' => ' smallint'
@@ -46,7 +47,12 @@ class CreateTableSQLRewriter extends AbstractSQLRewriter
$table = $matches[1];
// Remove trailing spaces
$sql = trim($sql) . ';';
$sql = trim($sql);
// Add a slash if needed
if (substr($sql,strlen($sql)-1, 1) != ";") {
$sql = $sql . ";";
}
// Translate types and some other replacements
$sql = str_ireplace(