From 04e8818d46204033b00607a15d9ac1a37b5ef372 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 14 Mar 2021 09:07:47 +0100 Subject: [PATCH] Use new database PIP for update scripts --- com.woltlab.wcf/package.xml | 10 +++++----- .../update_com.woltlab.wcf_5.4.php} | 12 +----------- ...te_com.woltlab.wcf_5.4_session_2_user_session.php | 12 +----------- ...te_com.woltlab.wcf_5.4_session_4_drop_virtual.php | 12 +----------- ...update_com.woltlab.wcf_5.4_session_5_drop_acp.php | 12 +----------- ...e_com.woltlab.wcf_5.4_session_6_clean_session.php | 12 +----------- ..._com.woltlab.wcf_5.4_wcf1_tag_to_object_step1.php | 12 +----------- ..._com.woltlab.wcf_5.4_wcf1_tag_to_object_step2.php | 12 +----------- ..._com.woltlab.wcf_5.4_wcf1_tag_to_object_step3.php | 12 +----------- ..._com.woltlab.wcf_5.4_wcf1_tag_to_object_step4.php | 12 +----------- 10 files changed, 14 insertions(+), 104 deletions(-) rename wcfsetup/install/files/acp/{update_com.woltlab.wcf_5.4_db.php => database/update_com.woltlab.wcf_5.4.php} (96%) rename wcfsetup/install/files/acp/{ => database}/update_com.woltlab.wcf_5.4_session_2_user_session.php (88%) rename wcfsetup/install/files/acp/{ => database}/update_com.woltlab.wcf_5.4_session_4_drop_virtual.php (62%) rename wcfsetup/install/files/acp/{ => database}/update_com.woltlab.wcf_5.4_session_5_drop_acp.php (57%) rename wcfsetup/install/files/acp/{ => database}/update_com.woltlab.wcf_5.4_session_6_clean_session.php (75%) diff --git a/com.woltlab.wcf/package.xml b/com.woltlab.wcf/package.xml index 712c051f95..4a49681a02 100644 --- a/com.woltlab.wcf/package.xml +++ b/com.woltlab.wcf/package.xml @@ -79,7 +79,7 @@ tar cvf com.woltlab.wcf/files_pre.tar -C wcfsetup/install/files/ \ acp/update_com.woltlab.wcf_5.4_session_1_cookies.php - acp/update_com.woltlab.wcf_5.4_session_2_user_session.php + acp/database/update_com.woltlab.wcf_5.4_session_2_user_session.php acp/update_com.woltlab.wcf_5.4_session_3_migrate_session.php @@ -91,12 +91,12 @@ tar cvf com.woltlab.wcf/files_pre.tar -C wcfsetup/install/files/ \ - acp/update_com.woltlab.wcf_5.4_session_4_drop_virtual.php - acp/update_com.woltlab.wcf_5.4_session_5_drop_acp.php - acp/update_com.woltlab.wcf_5.4_session_6_clean_session.php + acp/database/update_com.woltlab.wcf_5.4_session_4_drop_virtual.php + acp/database/update_com.woltlab.wcf_5.4_session_5_drop_acp.php + acp/database/update_com.woltlab.wcf_5.4_session_6_clean_session.php - acp/update_com.woltlab.wcf_5.4_db.php + acp/database/update_com.woltlab.wcf_5.4.php acp/update_com.woltlab.wcf_5.4_wcf1_tag_to_object_step1.php diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_db.php b/wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.4.php similarity index 96% rename from wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_db.php rename to wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.4.php index 36a2784b88..7012ff3321 100644 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_db.php +++ b/wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.4.php @@ -21,15 +21,12 @@ use wcf\system\database\table\column\ObjectIdDatabaseTableColumn; use wcf\system\database\table\column\TextDatabaseTableColumn; use wcf\system\database\table\column\VarbinaryDatabaseTableColumn; use wcf\system\database\table\DatabaseTable; -use wcf\system\database\table\DatabaseTableChangeProcessor; use wcf\system\database\table\index\DatabaseTableForeignKey; use wcf\system\database\table\index\DatabaseTableIndex; use wcf\system\database\table\index\DatabaseTablePrimaryIndex; use wcf\system\database\table\PartialDatabaseTable; -use wcf\system\package\plugin\ScriptPackageInstallationPlugin; -use wcf\system\WCF; -$tables = [ +return [ DatabaseTable::create('wcf1_email_log_entry') ->columns([ ObjectIdDatabaseTableColumn::create('entryID'), @@ -223,10 +220,3 @@ $tables = [ DefaultFalseBooleanDatabaseTableColumn::create('invertPermissions'), ]), ]; - -(new DatabaseTableChangeProcessor( - /** @var ScriptPackageInstallationPlugin $this */ - $this->installation->getPackage(), - $tables, - WCF::getDB()->getEditor() -))->process(); diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_session_2_user_session.php b/wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.4_session_2_user_session.php similarity index 88% rename from wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_session_2_user_session.php rename to wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.4_session_2_user_session.php index e7469ef3c3..e2b5caa897 100644 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_session_2_user_session.php +++ b/wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.4_session_2_user_session.php @@ -16,12 +16,10 @@ use wcf\system\database\table\column\NotNullInt10DatabaseTableColumn; use wcf\system\database\table\column\NotNullVarchar255DatabaseTableColumn; use wcf\system\database\table\column\VarcharDatabaseTableColumn; use wcf\system\database\table\DatabaseTable; -use wcf\system\database\table\DatabaseTableChangeProcessor; use wcf\system\database\table\index\DatabaseTableForeignKey; use wcf\system\database\table\index\DatabaseTableIndex; -use wcf\system\WCF; -$tables = [ +return [ DatabaseTable::create('wcf1_user_session') ->columns([ CharDatabaseTableColumn::create('sessionID') @@ -55,11 +53,3 @@ $tables = [ ->onDelete('CASCADE'), ]), ]; - -(new DatabaseTableChangeProcessor( -/** @var ScriptPackageInstallationPlugin $this */ - $this->installation->getPackage(), - $tables, - WCF::getDB()->getEditor() -) -)->process(); diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_session_4_drop_virtual.php b/wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.4_session_4_drop_virtual.php similarity index 62% rename from wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_session_4_drop_virtual.php rename to wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.4_session_4_drop_virtual.php index afa70f5345..81c1543c7b 100644 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_session_4_drop_virtual.php +++ b/wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.4_session_4_drop_virtual.php @@ -9,21 +9,11 @@ * @package WoltLabSuite\Core */ -use wcf\system\database\table\DatabaseTableChangeProcessor; use wcf\system\database\table\PartialDatabaseTable; -use wcf\system\WCF; -$tables = [ +return [ PartialDatabaseTable::create('wcf1_session_virtual') ->drop(), PartialDatabaseTable::create('wcf1_acp_session_virtual') ->drop(), ]; - -(new DatabaseTableChangeProcessor( -/** @var ScriptPackageInstallationPlugin $this */ - $this->installation->getPackage(), - $tables, - WCF::getDB()->getEditor() -) -)->process(); diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_session_5_drop_acp.php b/wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.4_session_5_drop_acp.php similarity index 57% rename from wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_session_5_drop_acp.php rename to wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.4_session_5_drop_acp.php index e3c8100c60..89321e373f 100644 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_session_5_drop_acp.php +++ b/wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.4_session_5_drop_acp.php @@ -9,19 +9,9 @@ * @package WoltLabSuite\Core */ -use wcf\system\database\table\DatabaseTableChangeProcessor; use wcf\system\database\table\PartialDatabaseTable; -use wcf\system\WCF; -$tables = [ +return [ PartialDatabaseTable::create('wcf1_acp_session') ->drop(), ]; - -(new DatabaseTableChangeProcessor( -/** @var ScriptPackageInstallationPlugin $this */ - $this->installation->getPackage(), - $tables, - WCF::getDB()->getEditor() -) -)->process(); diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_session_6_clean_session.php b/wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.4_session_6_clean_session.php similarity index 75% rename from wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_session_6_clean_session.php rename to wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.4_session_6_clean_session.php index 369b494277..7496e0f554 100644 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_session_6_clean_session.php +++ b/wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.4_session_6_clean_session.php @@ -11,11 +11,9 @@ use wcf\system\database\table\column\MediumblobDatabaseTableColumn; use wcf\system\database\table\column\NotNullVarchar255DatabaseTableColumn; -use wcf\system\database\table\DatabaseTableChangeProcessor; use wcf\system\database\table\PartialDatabaseTable; -use wcf\system\WCF; -$tables = [ +return [ PartialDatabaseTable::create('wcf1_acp_session_access_log') ->columns([ NotNullVarchar255DatabaseTableColumn::create('requestMethod') @@ -26,11 +24,3 @@ $tables = [ MediumblobDatabaseTableColumn::create('sessionVariables')->drop(), ]), ]; - -(new DatabaseTableChangeProcessor( -/** @var ScriptPackageInstallationPlugin $this */ - $this->installation->getPackage(), - $tables, - WCF::getDB()->getEditor() -) -)->process(); diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_wcf1_tag_to_object_step1.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_wcf1_tag_to_object_step1.php index 2cf146b83f..28b5b973c3 100644 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_wcf1_tag_to_object_step1.php +++ b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_wcf1_tag_to_object_step1.php @@ -11,14 +11,11 @@ * @package WoltLabSuite\Core */ -use wcf\system\database\table\DatabaseTableChangeProcessor; use wcf\system\database\table\index\DatabaseTableForeignKey; use wcf\system\database\table\index\DatabaseTableIndex; use wcf\system\database\table\PartialDatabaseTable; -use wcf\system\package\plugin\ScriptPackageInstallationPlugin; -use wcf\system\WCF; -$tables = [ +return [ PartialDatabaseTable::create('wcf1_tag_to_object') ->foreignKeys([ DatabaseTableForeignKey::create() @@ -50,10 +47,3 @@ $tables = [ ->drop(), ]), ]; - -(new DatabaseTableChangeProcessor( - /** @var ScriptPackageInstallationPlugin $this */ - $this->installation->getPackage(), - $tables, - WCF::getDB()->getEditor() -))->process(); diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_wcf1_tag_to_object_step2.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_wcf1_tag_to_object_step2.php index 2e5c31bbfd..bd1b46c8f3 100644 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_wcf1_tag_to_object_step2.php +++ b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_wcf1_tag_to_object_step2.php @@ -9,13 +9,10 @@ * @package WoltLabSuite\Core */ -use wcf\system\database\table\DatabaseTableChangeProcessor; use wcf\system\database\table\index\DatabaseTableIndex; use wcf\system\database\table\PartialDatabaseTable; -use wcf\system\package\plugin\ScriptPackageInstallationPlugin; -use wcf\system\WCF; -$tables = [ +return [ PartialDatabaseTable::create('wcf1_tag_to_object') ->indices([ DatabaseTableIndex::create() @@ -23,10 +20,3 @@ $tables = [ ->drop(), ]), ]; - -(new DatabaseTableChangeProcessor( - /** @var ScriptPackageInstallationPlugin $this */ - $this->installation->getPackage(), - $tables, - WCF::getDB()->getEditor() -))->process(); diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_wcf1_tag_to_object_step3.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_wcf1_tag_to_object_step3.php index 742554fb3e..8d1cfd77ca 100644 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_wcf1_tag_to_object_step3.php +++ b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_wcf1_tag_to_object_step3.php @@ -9,14 +9,11 @@ * @package WoltLabSuite\Core */ -use wcf\system\database\table\DatabaseTableChangeProcessor; use wcf\system\database\table\index\DatabaseTableForeignKey; use wcf\system\database\table\index\DatabaseTablePrimaryIndex; use wcf\system\database\table\PartialDatabaseTable; -use wcf\system\package\plugin\ScriptPackageInstallationPlugin; -use wcf\system\WCF; -$tables = [ +return [ PartialDatabaseTable::create('wcf1_tag_to_object') ->foreignKeys([ DatabaseTableForeignKey::create() @@ -40,10 +37,3 @@ $tables = [ ->columns(['objectTypeID', 'objectID', 'tagID']), ]), ]; - -(new DatabaseTableChangeProcessor( - /** @var ScriptPackageInstallationPlugin $this */ - $this->installation->getPackage(), - $tables, - WCF::getDB()->getEditor() -))->process(); diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_wcf1_tag_to_object_step4.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_wcf1_tag_to_object_step4.php index c9ad57aee0..bb2f5267d9 100644 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_wcf1_tag_to_object_step4.php +++ b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_wcf1_tag_to_object_step4.php @@ -9,13 +9,10 @@ * @package WoltLabSuite\Core */ -use wcf\system\database\table\DatabaseTableChangeProcessor; use wcf\system\database\table\index\DatabaseTableIndex; use wcf\system\database\table\PartialDatabaseTable; -use wcf\system\package\plugin\ScriptPackageInstallationPlugin; -use wcf\system\WCF; -$tables = [ +return [ PartialDatabaseTable::create('wcf1_tag_to_object') ->indices([ DatabaseTableIndex::create() @@ -24,10 +21,3 @@ $tables = [ ->columns(['tagID']), ]), ]; - -(new DatabaseTableChangeProcessor( - /** @var ScriptPackageInstallationPlugin $this */ - $this->installation->getPackage(), - $tables, - WCF::getDB()->getEditor() -))->process(); -- 2.20.1