Commit ec89e245 authored by eileen's avatar eileen 🎱 Committed by GitHub

Merge pull request #9783 from mattwire/back_to_single_lang

CRM-19968 SQL tweaks to make it more likely that reverting to single language w…
parents 3cbd0f4f 40ee1db2
......@@ -188,18 +188,20 @@ class CRM_Core_I18n_Schema {
}
}
$dao = new CRM_Core_DAO();
// deal with columns
foreach ($columns[$table] as $column => $type) {
$queries[] = "ALTER TABLE {$table} ADD {$column} {$type}";
$queries[] = "UPDATE {$table} SET {$column} = {$column}_{$retain}";
$queries[] = "ALTER TABLE {$table} CHANGE `{$column}_{$retain}` `{$column}` {$type}";
foreach ($locales as $loc) {
$dropQueries[] = "ALTER TABLE {$table} DROP {$column}_{$loc}";
if (strcmp($loc, $retain) !== 0) {
$dropQueries[] = "ALTER TABLE {$table} DROP {$column}_{$loc}";
}
}
}
// drop views
foreach ($locales as $loc) {
$queries[] = "DROP VIEW {$table}_{$loc}";
$queries[] = "DROP VIEW IF EXISTS {$table}_{$loc}";
}
// add original indices
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment