mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-22 09:08:01 +01:00
Fix CorrectWrongCharacterEncodingPatch applying to non Plan tables in same database
This commit is contained in:
parent
ac74d3cd4e
commit
511b41eb68
@ -63,6 +63,7 @@ public class CorrectWrongCharacterEncodingPatch extends Patch {
|
||||
String selectTablesWithWrongCharset = "SELECT CONCAT('ALTER TABLE `', table_name, '` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;')\n" +
|
||||
"FROM information_schema.TABLES AS T, information_schema.`COLLATION_CHARACTER_SET_APPLICABILITY` AS C\n" +
|
||||
"WHERE C.collation_name = T.table_collation\n" +
|
||||
"AND T.table_name LIKE 'plan\\_%'\n" +
|
||||
"AND T.table_schema = '" + databaseName + "'\n" +
|
||||
"AND\n" +
|
||||
"(\n" +
|
||||
@ -74,6 +75,7 @@ public class CorrectWrongCharacterEncodingPatch extends Patch {
|
||||
String selectColumnsWithWrongCharset = "SELECT CONCAT('ALTER TABLE `', table_name, '` MODIFY `', column_name, '` ', DATA_TYPE, '(', CHARACTER_MAXIMUM_LENGTH, ') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci', (CASE WHEN IS_NULLABLE = 'NO' THEN ' NOT NULL' ELSE '' END), ';')\n" +
|
||||
"FROM information_schema.COLUMNS \n" +
|
||||
"WHERE TABLE_SCHEMA = '" + databaseName + "'\n" +
|
||||
"AND table_name LIKE 'plan\\_%'\n" +
|
||||
"AND DATA_TYPE = 'varchar'\n" +
|
||||
"AND\n" +
|
||||
"(\n" +
|
||||
|
Loading…
Reference in New Issue
Block a user