From: Matthias Schmidt Date: Sun, 10 Nov 2019 09:37:54 +0000 (+0100) Subject: Make `wcf1_package.package` have a unique key X-Git-Tag: 5.2.0_Beta_3~12 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=60a5e9e5cc7b2f375f653f4db40e5d63ffd1936e;p=GitHub%2FWoltLab%2FWCF.git Make `wcf1_package.package` have a unique key Close #3099 --- diff --git a/com.woltlab.wcf/package.xml b/com.woltlab.wcf/package.xml index f50389fca9..e8fce6992f 100644 --- a/com.woltlab.wcf/package.xml +++ b/com.woltlab.wcf/package.xml @@ -54,6 +54,7 @@ acptemplates_update.tar files_update.tar templates_update.tar + acp/update-com.woltlab.wcf_5.2.0_beta_3.php diff --git a/wcfsetup/install/files/acp/update-com.woltlab.wcf_5.2.0_beta_3.php b/wcfsetup/install/files/acp/update-com.woltlab.wcf_5.2.0_beta_3.php new file mode 100644 index 0000000000..dee5ddc892 --- /dev/null +++ b/wcfsetup/install/files/acp/update-com.woltlab.wcf_5.2.0_beta_3.php @@ -0,0 +1,34 @@ + + */ + +$tables = [ + PartialDatabaseTable::create('wcf1_package') + ->indices([ + DatabaseTableIndex::create('package') + ->columns(['package']) + ->drop(), + + DatabaseTableIndex::create() + ->type(DatabaseTableIndex::UNIQUE_TYPE) + ->columns(['package']) + ]) +]; + +(new DatabaseTableChangeProcessor( +/** @var ScriptPackageInstallationPlugin $this */ + $this->installation->getPackage(), + $tables, + WCF::getDB()->getEditor()) +)->process(); diff --git a/wcfsetup/setup/db/install.sql b/wcfsetup/setup/db/install.sql index 5c751c48e1..2cf567d6e9 100644 --- a/wcfsetup/setup/db/install.sql +++ b/wcfsetup/setup/db/install.sql @@ -910,7 +910,7 @@ CREATE TABLE wcf1_package ( isApplication TINYINT(1) NOT NULL DEFAULT 0, author VARCHAR(255) NOT NULL DEFAULT '', authorURL VARCHAR(255) NOT NULL DEFAULT '', - KEY package (package) + UNIQUE KEY package (package) ); DROP TABLE IF EXISTS wcf1_package_compatibility;