From 030e150d3e38b58d9adf1719febabf51ed720864 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 11 Dec 2019 17:43:52 +0100 Subject: [PATCH] Incorrect foreign key comparison in MySQL 8, Code cleanup, Repeatable upgrade for failed DB migrations --- com.woltlab.wcf/files_pre.tar | Bin 195584 -> 198144 bytes com.woltlab.wcf/package.xml | 20 +++++++-------- com.woltlab.wcf/update_5.2.sql | 2 ++ com.woltlab.wcf/update_5.2_pre_sql_api.sql | 6 ----- ...5.2.php => update_com.woltlab.wcf_5.2.php} | 7 ------ .../update_com.woltlab.wcf_5.2_prePhpApi.php | 23 ++++++++++++++++++ ...te_com.woltlab.wcf_5.2_reactionUpdate.php} | 0 ...ate_com.woltlab.wcf_5.2_reloadOptions.php} | 0 .../index/DatabaseTableForeignKey.class.php | 20 +++++++++++++-- 9 files changed, 53 insertions(+), 25 deletions(-) create mode 100644 com.woltlab.wcf/update_5.2.sql delete mode 100644 com.woltlab.wcf/update_5.2_pre_sql_api.sql rename wcfsetup/install/files/acp/{update-com.woltlab.wcf_5.2.php => update_com.woltlab.wcf_5.2.php} (96%) create mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_5.2_prePhpApi.php rename wcfsetup/install/files/acp/{update-com.woltlab.wcf_5.2_reactionUpdate.php => update_com.woltlab.wcf_5.2_reactionUpdate.php} (100%) rename wcfsetup/install/files/acp/{update-com.woltlab.wcf_5.2_reloadOptions.php => update_com.woltlab.wcf_5.2_reloadOptions.php} (100%) diff --git a/com.woltlab.wcf/files_pre.tar b/com.woltlab.wcf/files_pre.tar index 513c0bc6454d9b9f0c41a3a53b01e3a54fdfc84c..dc0774f9d6ffa1eaa3602116baefe76e8a16d995 100644 GIT binary patch delta 20221 zcmch933yahmT=!own|c2$X1n9l9#nAAxkZ(1VNBMf`%=uqCyNsQjn4)6)P1XEi}@N z-Oh+2T&b%Dk+`CQ1W}PiMBCAJLB(;mn}(jAcB7RUdcm!obMAYu_R!4y-}m!D@s_)s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,23 +60,23 @@ - update_5.2_pre_sql_api.sql - - + files_pre.tar - + - - acp/update-com.woltlab.wcf_5.2.php + acp/update_com.woltlab.wcf_5.2_prePhpApi.php + + acp/update_com.woltlab.wcf_5.2.php + + + acp/update_com.woltlab.wcf_5.2_reactionUpdate.php - - acp/update-com.woltlab.wcf_5.2_reactionUpdate.php + update_5.2.sql - - acp/update-com.woltlab.wcf_5.2_reloadOptions.php + acp/update_com.woltlab.wcf_5.2_reloadOptions.php diff --git a/com.woltlab.wcf/update_5.2.sql b/com.woltlab.wcf/update_5.2.sql new file mode 100644 index 0000000000..5fbc40d4f1 --- /dev/null +++ b/com.woltlab.wcf/update_5.2.sql @@ -0,0 +1,2 @@ +INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfEditorTableBorder', 'rgba(221, 221, 221, 1)'); +INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfPageThemeColor', ''); -- uses `$wcfHeaderBackground` if left empty diff --git a/com.woltlab.wcf/update_5.2_pre_sql_api.sql b/com.woltlab.wcf/update_5.2_pre_sql_api.sql deleted file mode 100644 index 3336bfe03c..0000000000 --- a/com.woltlab.wcf/update_5.2_pre_sql_api.sql +++ /dev/null @@ -1,6 +0,0 @@ --- The database API requires this column in order to work properly. DO NOT MOVE THIS! -ALTER TABLE wcf1_package_installation_sql_log ADD COLUMN isDone TINYINT(1) NOT NULL DEFAULT 1; - --- Let's do this here too, so we won't need another step for inserting two values -INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfEditorTableBorder', 'rgba(221, 221, 221, 1)'); -INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfPageThemeColor', ''); -- uses `$wcfHeaderBackground` if left empty diff --git a/wcfsetup/install/files/acp/update-com.woltlab.wcf_5.2.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.2.php similarity index 96% rename from wcfsetup/install/files/acp/update-com.woltlab.wcf_5.2.php rename to wcfsetup/install/files/acp/update_com.woltlab.wcf_5.2.php index e4896d7914..04d7c03226 100644 --- a/wcfsetup/install/files/acp/update-com.woltlab.wcf_5.2.php +++ b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.2.php @@ -147,13 +147,6 @@ $tables = [ ->onDelete('SET NULL') ]), - // Re-create the key to turn it into a unique key: https://github.com/WoltLab/WCF/issues/3116 - DatabaseTable::create('wcf1_package') - ->indices([ - DatabaseTableIndex::create('package') - ->columns(['package']) - ->drop() - ]), DatabaseTable::create('wcf1_package') ->indices([ DatabaseTableIndex::create('package') diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.2_prePhpApi.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.2_prePhpApi.php new file mode 100644 index 0000000000..1f9df9dce4 --- /dev/null +++ b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.2_prePhpApi.php @@ -0,0 +1,23 @@ +getEditor(); +$existingColumns = $dbEditor->getColumns('wcf'.WCF_N.'_package_installation_sql_log'); +$hasIsDoneColumn = false; +foreach ($existingColumns as $column) { + if ($column['name'] === 'isDone') { + $hasIsDoneColumn = true; + break; + } +} + +if (!$hasIsDoneColumn) { + $dbEditor->addColumn('wcf'.WCF_N.'_package_installation_sql_log', 'isDone', [ + 'type' => 'tinyint', + 'length' => 1, + 'notNull' => 1, + 'default' => 1, + ]); +} diff --git a/wcfsetup/install/files/acp/update-com.woltlab.wcf_5.2_reactionUpdate.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.2_reactionUpdate.php similarity index 100% rename from wcfsetup/install/files/acp/update-com.woltlab.wcf_5.2_reactionUpdate.php rename to wcfsetup/install/files/acp/update_com.woltlab.wcf_5.2_reactionUpdate.php diff --git a/wcfsetup/install/files/acp/update-com.woltlab.wcf_5.2_reloadOptions.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.2_reloadOptions.php similarity index 100% rename from wcfsetup/install/files/acp/update-com.woltlab.wcf_5.2_reloadOptions.php rename to wcfsetup/install/files/acp/update_com.woltlab.wcf_5.2_reloadOptions.php diff --git a/wcfsetup/install/files/lib/system/database/table/index/DatabaseTableForeignKey.class.php b/wcfsetup/install/files/lib/system/database/table/index/DatabaseTableForeignKey.class.php index 65d332aff0..e2edc165d2 100644 --- a/wcfsetup/install/files/lib/system/database/table/index/DatabaseTableForeignKey.class.php +++ b/wcfsetup/install/files/lib/system/database/table/index/DatabaseTableForeignKey.class.php @@ -116,8 +116,8 @@ class DatabaseTableForeignKey { public function getData() { return [ 'columns' => implode(',', $this->getColumns()), - 'ON DELETE' => $this->getOnDelete(), - 'ON UPDATE' => $this->getOnUpdate(), + 'ON DELETE' => $this->normalizeAction($this->getOnDelete()), + 'ON UPDATE' => $this->normalizeAction($this->getOnUpdate()), 'referencedColumns' => implode(',', $this->getReferencedColumns()), 'referencedTable' => $this->getReferencedTable() ]; @@ -243,6 +243,22 @@ class DatabaseTableForeignKey { return $this; } + /** + * In MySQL, `ON * RESTRICT`, `ON * NO ACTION` or omitting it entirely, is completely the same. However, + * MySQL 8 reports `NO ACTION` where MySQL 5.7 would identify the action as `null`. This method normalized + * the action, by always setting it to null if the value is `RESTRICT` or `NO ACTION`. + * + * @param string $action + * @return string|null + */ + protected function normalizeAction($action) { + if ($action === 'RESTRICT' || $action === 'NO ACTION') { + return null; + } + + return $action; + } + /** * Returns a `DatabaseTableForeignKey` object with the given name. * -- 2.20.1