Use new database PIP for update scripts
authorMatthias Schmidt <gravatronics@live.com>
Sun, 14 Mar 2021 08:07:47 +0000 (09:07 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 14 Mar 2021 08:07:47 +0000 (09:07 +0100)
15 files changed:
com.woltlab.wcf/package.xml
wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.4.php [new file with mode: 0644]
wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.4_session_2_user_session.php [new file with mode: 0644]
wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.4_session_4_drop_virtual.php [new file with mode: 0644]
wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.4_session_5_drop_acp.php [new file with mode: 0644]
wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.4_session_6_clean_session.php [new file with mode: 0644]
wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_db.php [deleted file]
wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_session_2_user_session.php [deleted file]
wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_session_4_drop_virtual.php [deleted file]
wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_session_5_drop_acp.php [deleted file]
wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_session_6_clean_session.php [deleted file]
wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_wcf1_tag_to_object_step1.php
wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_wcf1_tag_to_object_step2.php
wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_wcf1_tag_to_object_step3.php
wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_wcf1_tag_to_object_step4.php

index 712c051f956dc7448d267f233f73581ca07ff593..4a49681a02e2f195e3cbb71985a89216359c962d 100644 (file)
@@ -79,7 +79,7 @@ tar cvf com.woltlab.wcf/files_pre.tar -C wcfsetup/install/files/ \
 
                <!-- Preparations for the new session system. -->
                <instruction type="script" run="standalone">acp/update_com.woltlab.wcf_5.4_session_1_cookies.php</instruction>
-               <instruction type="script" run="standalone">acp/update_com.woltlab.wcf_5.4_session_2_user_session.php</instruction>
+               <instruction type="database" run="standalone">acp/database/update_com.woltlab.wcf_5.4_session_2_user_session.php</instruction>
                <instruction type="script" run="standalone">acp/update_com.woltlab.wcf_5.4_session_3_migrate_session.php</instruction>
                
                <!-- New application code. -->
@@ -91,12 +91,12 @@ tar cvf com.woltlab.wcf/files_pre.tar -C wcfsetup/install/files/ \
                <instruction type="option" run="standalone" />
                
                <!-- Cleanup for the new session system. -->
-               <instruction type="script" run="standalone">acp/update_com.woltlab.wcf_5.4_session_4_drop_virtual.php</instruction>
-               <instruction type="script" run="standalone">acp/update_com.woltlab.wcf_5.4_session_5_drop_acp.php</instruction>
-               <instruction type="script" run="standalone">acp/update_com.woltlab.wcf_5.4_session_6_clean_session.php</instruction>
+               <instruction type="database" run="standalone">acp/database/update_com.woltlab.wcf_5.4_session_4_drop_virtual.php</instruction>
+               <instruction type="database" run="standalone">acp/database/update_com.woltlab.wcf_5.4_session_5_drop_acp.php</instruction>
+               <instruction type="database" run="standalone">acp/database/update_com.woltlab.wcf_5.4_session_6_clean_session.php</instruction>
                
                <!-- Non-critical database adjustments. -->
-               <instruction type="script" run="standalone">acp/update_com.woltlab.wcf_5.4_db.php</instruction>
+               <instruction type="database" run="standalone">acp/database/update_com.woltlab.wcf_5.4.php</instruction>
                
                <!-- Index updates for `wcf1_tag_to_object`. -->
                <instruction type="script" run="standalone">acp/update_com.woltlab.wcf_5.4_wcf1_tag_to_object_step1.php</instruction>
diff --git a/wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.4.php b/wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.4.php
new file mode 100644 (file)
index 0000000..7012ff3
--- /dev/null
@@ -0,0 +1,222 @@
+<?php
+
+/**
+ * Makes non-critical database adjustments (i.e. everything that is not related
+ * to sessions).
+ *
+ * @author  Tim Duesterhus
+ * @copyright   2001-2021 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core
+ */
+
+use wcf\system\database\table\column\BigintDatabaseTableColumn;
+use wcf\system\database\table\column\BinaryDatabaseTableColumn;
+use wcf\system\database\table\column\DefaultFalseBooleanDatabaseTableColumn;
+use wcf\system\database\table\column\EnumDatabaseTableColumn;
+use wcf\system\database\table\column\IntDatabaseTableColumn;
+use wcf\system\database\table\column\NotNullInt10DatabaseTableColumn;
+use wcf\system\database\table\column\NotNullVarchar255DatabaseTableColumn;
+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\index\DatabaseTableForeignKey;
+use wcf\system\database\table\index\DatabaseTableIndex;
+use wcf\system\database\table\index\DatabaseTablePrimaryIndex;
+use wcf\system\database\table\PartialDatabaseTable;
+
+return [
+    DatabaseTable::create('wcf1_email_log_entry')
+        ->columns([
+            ObjectIdDatabaseTableColumn::create('entryID'),
+            NotNullInt10DatabaseTableColumn::create('time'),
+            NotNullVarchar255DatabaseTableColumn::create('messageID'),
+            NotNullVarchar255DatabaseTableColumn::create('subject'),
+            NotNullVarchar255DatabaseTableColumn::create('recipient'),
+            IntDatabaseTableColumn::create('recipientID')
+                ->length(10)
+                ->notNull(false),
+            NotNullVarchar255DatabaseTableColumn::create('status'),
+            TextDatabaseTableColumn::create('message'),
+        ])
+        ->indices([
+            DatabaseTablePrimaryIndex::create()
+                ->columns(['entryID']),
+            DatabaseTableIndex::create('time')
+                ->columns(['time']),
+        ])
+        ->foreignKeys([
+            DatabaseTableForeignKey::create()
+                ->columns(['recipientID'])
+                ->referencedTable('wcf1_user')
+                ->referencedColumns(['userID'])
+                ->onDelete('SET NULL'),
+        ]),
+
+    // This update script was added with 5.3.3. We need to ensure that the change is applied
+    // when someone attempts to upgrade from an older 5.3.x for whatever reason.
+    // If the database already has the proper state this will be a simple noop.
+    //
+    // see: https://github.com/WoltLab/WCF/commit/d836d365d30d44c6140dda17f82b9bd245db03e9
+    PartialDatabaseTable::create('wcf1_event_listener')
+        ->columns([
+            EnumDatabaseTableColumn::create('environment')
+                ->enumValues(['user', 'admin', 'all']),
+        ]),
+
+    DatabaseTable::create('wcf1_flood_control')
+        ->columns([
+            BigintDatabaseTableColumn::create('logID')
+                ->length(20)
+                ->notNull()
+                ->autoIncrement(),
+            NotNullInt10DatabaseTableColumn::create('objectTypeID'),
+            BinaryDatabaseTableColumn::create('identifier')
+                ->length(16)
+                ->notNull(),
+            NotNullInt10DatabaseTableColumn::create('time'),
+        ])
+        ->indices([
+            DatabaseTablePrimaryIndex::create()
+                ->columns(['logID']),
+            DatabaseTableIndex::create()
+                ->columns(['identifier']),
+            DatabaseTableIndex::create()
+                ->columns(['time']),
+        ]),
+
+    PartialDatabaseTable::create('wcf1_page_content')
+        ->columns([
+            TextDatabaseTableColumn::create('metaKeywords')
+                ->drop(),
+        ]),
+
+    PartialDatabaseTable::create('wcf1_user')
+        ->columns([
+            DefaultFalseBooleanDatabaseTableColumn::create('coverPhotoHasWebP'),
+            DefaultFalseBooleanDatabaseTableColumn::create('multifactorActive'),
+        ]),
+
+    PartialDatabaseTable::create('wcf1_user_authentication_failure')
+        ->columns([
+            NotNullVarchar255DatabaseTableColumn::create('validationError')
+                ->defaultValue(''),
+        ]),
+
+    PartialDatabaseTable::create('wcf1_user_avatar')
+        ->columns([
+            DefaultFalseBooleanDatabaseTableColumn::create("hasWebP"),
+        ]),
+
+    PartialDatabaseTable::create('wcf1_user_group')
+        ->columns([
+            DefaultFalseBooleanDatabaseTableColumn::create('requireMultifactor'),
+        ]),
+
+    DatabaseTable::create('wcf1_user_multifactor')
+        ->columns([
+            ObjectIdDatabaseTableColumn::create('setupID'),
+            NotNullInt10DatabaseTableColumn::create('userID'),
+            NotNullInt10DatabaseTableColumn::create('objectTypeID'),
+        ])
+        ->indices([
+            DatabaseTablePrimaryIndex::create()
+                ->columns(['setupID']),
+            DatabaseTableIndex::create()
+                ->type(DatabaseTableIndex::UNIQUE_TYPE)
+                ->columns(['userID', 'objectTypeID']),
+        ])
+        ->foreignKeys([
+            DatabaseTableForeignKey::create()
+                ->columns(['userID'])
+                ->referencedTable('wcf1_user')
+                ->referencedColumns(['userID'])
+                ->onDelete('CASCADE'),
+            DatabaseTableForeignKey::create()
+                ->columns(['objectTypeID'])
+                ->referencedTable('wcf1_object_type')
+                ->referencedColumns(['objectTypeID'])
+                ->onDelete('CASCADE'),
+        ]),
+
+    DatabaseTable::create('wcf1_user_multifactor_backup')
+        ->columns([
+            NotNullInt10DatabaseTableColumn::create('setupID'),
+            NotNullVarchar255DatabaseTableColumn::create('identifier'),
+            NotNullVarchar255DatabaseTableColumn::create('code'),
+            NotNullInt10DatabaseTableColumn::create('createTime'),
+            IntDatabaseTableColumn::create('useTime')
+                ->length(10)
+                ->defaultValue(null),
+        ])
+        ->indices([
+            DatabaseTableIndex::create()
+                ->type(DatabaseTableIndex::UNIQUE_TYPE)
+                ->columns(['setupID', 'identifier']),
+        ])
+        ->foreignKeys([
+            DatabaseTableForeignKey::create()
+                ->columns(['setupID'])
+                ->referencedTable('wcf1_user_multifactor')
+                ->referencedColumns(['setupID'])
+                ->onDelete('CASCADE'),
+        ]),
+
+    DatabaseTable::create('wcf1_user_multifactor_email')
+        ->columns([
+            NotNullInt10DatabaseTableColumn::create('setupID'),
+            NotNullVarchar255DatabaseTableColumn::create('code'),
+            NotNullInt10DatabaseTableColumn::create('createTime'),
+        ])
+        ->indices([
+            DatabaseTableIndex::create()
+                ->type(DatabaseTableIndex::UNIQUE_TYPE)
+                ->columns(['setupID', 'code']),
+        ])
+        ->foreignKeys([
+            DatabaseTableForeignKey::create()
+                ->columns(['setupID'])
+                ->referencedTable('wcf1_user_multifactor')
+                ->referencedColumns(['setupID'])
+                ->onDelete('CASCADE'),
+        ]),
+
+    DatabaseTable::create('wcf1_user_multifactor_totp')
+        ->columns([
+            NotNullInt10DatabaseTableColumn::create('setupID'),
+            NotNullVarchar255DatabaseTableColumn::create('deviceID'),
+            NotNullVarchar255DatabaseTableColumn::create('deviceName'),
+            VarbinaryDatabaseTableColumn::create('secret')
+                ->notNull()
+                ->length(255),
+            NotNullInt10DatabaseTableColumn::create('minCounter'),
+            NotNullInt10DatabaseTableColumn::create('createTime'),
+            IntDatabaseTableColumn::create('useTime')
+                ->length(10)
+                ->notNull(false)
+                ->defaultValue(null),
+        ])
+        ->indices([
+            DatabaseTableIndex::create()
+                ->type(DatabaseTableIndex::UNIQUE_TYPE)
+                ->columns(['setupID', 'deviceID']),
+        ])
+        ->foreignKeys([
+            DatabaseTableForeignKey::create()
+                ->columns(['setupID'])
+                ->referencedTable('wcf1_user_multifactor')
+                ->referencedColumns(['setupID'])
+                ->onDelete('CASCADE'),
+        ]),
+
+    PartialDatabaseTable::create('wcf1_box')
+        ->columns([
+            DefaultFalseBooleanDatabaseTableColumn::create('invertPermissions'),
+        ]),
+
+    PartialDatabaseTable::create('wcf1_page')
+        ->columns([
+            DefaultFalseBooleanDatabaseTableColumn::create('invertPermissions'),
+        ]),
+];
diff --git a/wcfsetup/install/files/acp/database/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
new file mode 100644 (file)
index 0000000..e2b5caa
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+
+/**
+ * Creates the user_session table.
+ *
+ * @author  Tim Duesterhus
+ * @copyright   2001-2020 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core
+ */
+
+use wcf\system\database\table\column\CharDatabaseTableColumn;
+use wcf\system\database\table\column\IntDatabaseTableColumn;
+use wcf\system\database\table\column\MediumblobDatabaseTableColumn;
+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\index\DatabaseTableForeignKey;
+use wcf\system\database\table\index\DatabaseTableIndex;
+
+return [
+    DatabaseTable::create('wcf1_user_session')
+        ->columns([
+            CharDatabaseTableColumn::create('sessionID')
+                ->length(40)
+                ->notNull(),
+            IntDatabaseTableColumn::create('userID')
+                ->length(10),
+            NotNullVarchar255DatabaseTableColumn::create('userAgent')
+                ->defaultValue(''),
+            VarcharDatabaseTableColumn::create('ipAddress')
+                ->length(39)
+                ->defaultValue(''),
+            NotNullInt10DatabaseTableColumn::create('lastActivityTime')
+                ->defaultValue(0),
+            MediumblobDatabaseTableColumn::create('sessionVariables'),
+        ])
+        ->indices([
+            DatabaseTableIndex::create()
+                ->type(DatabaseTableIndex::PRIMARY_TYPE)
+                ->columns(['sessionID']),
+            DatabaseTableIndex::create()
+                ->columns(['userID']),
+            DatabaseTableIndex::create()
+                ->columns(['lastActivityTime']),
+        ])
+        ->foreignKeys([
+            DatabaseTableForeignKey::create()
+                ->columns(['userID'])
+                ->referencedTable('wcf1_user')
+                ->referencedColumns(['userID'])
+                ->onDelete('CASCADE'),
+        ]),
+];
diff --git a/wcfsetup/install/files/acp/database/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
new file mode 100644 (file)
index 0000000..81c1543
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+
+/**
+ * Removes the *_session_virtual tables.
+ *
+ * @author  Tim Duesterhus
+ * @copyright   2001-2020 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core
+ */
+
+use wcf\system\database\table\PartialDatabaseTable;
+
+return [
+    PartialDatabaseTable::create('wcf1_session_virtual')
+        ->drop(),
+    PartialDatabaseTable::create('wcf1_acp_session_virtual')
+        ->drop(),
+];
diff --git a/wcfsetup/install/files/acp/database/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
new file mode 100644 (file)
index 0000000..89321e3
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+
+/**
+ * Removes the wcf1_acp_session table.
+ *
+ * @author  Tim Duesterhus
+ * @copyright   2001-2020 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core
+ */
+
+use wcf\system\database\table\PartialDatabaseTable;
+
+return [
+    PartialDatabaseTable::create('wcf1_acp_session')
+        ->drop(),
+];
diff --git a/wcfsetup/install/files/acp/database/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
new file mode 100644 (file)
index 0000000..7496e0f
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+
+/**
+ * Adjusts wcf1_acp_session_access_log and wcf1_session.
+ *
+ * @author  Tim Duesterhus
+ * @copyright   2001-2020 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core
+ */
+
+use wcf\system\database\table\column\MediumblobDatabaseTableColumn;
+use wcf\system\database\table\column\NotNullVarchar255DatabaseTableColumn;
+use wcf\system\database\table\PartialDatabaseTable;
+
+return [
+    PartialDatabaseTable::create('wcf1_acp_session_access_log')
+        ->columns([
+            NotNullVarchar255DatabaseTableColumn::create('requestMethod')
+                ->defaultValue(''),
+        ]),
+    PartialDatabaseTable::create('wcf1_session')
+        ->columns([
+            MediumblobDatabaseTableColumn::create('sessionVariables')->drop(),
+        ]),
+];
diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_db.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_db.php
deleted file mode 100644 (file)
index 36a2784..0000000
+++ /dev/null
@@ -1,232 +0,0 @@
-<?php
-
-/**
- * Makes non-critical database adjustments (i.e. everything that is not related
- * to sessions).
- *
- * @author  Tim Duesterhus
- * @copyright   2001-2021 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package WoltLabSuite\Core
- */
-
-use wcf\system\database\table\column\BigintDatabaseTableColumn;
-use wcf\system\database\table\column\BinaryDatabaseTableColumn;
-use wcf\system\database\table\column\DefaultFalseBooleanDatabaseTableColumn;
-use wcf\system\database\table\column\EnumDatabaseTableColumn;
-use wcf\system\database\table\column\IntDatabaseTableColumn;
-use wcf\system\database\table\column\NotNullInt10DatabaseTableColumn;
-use wcf\system\database\table\column\NotNullVarchar255DatabaseTableColumn;
-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 = [
-    DatabaseTable::create('wcf1_email_log_entry')
-        ->columns([
-            ObjectIdDatabaseTableColumn::create('entryID'),
-            NotNullInt10DatabaseTableColumn::create('time'),
-            NotNullVarchar255DatabaseTableColumn::create('messageID'),
-            NotNullVarchar255DatabaseTableColumn::create('subject'),
-            NotNullVarchar255DatabaseTableColumn::create('recipient'),
-            IntDatabaseTableColumn::create('recipientID')
-                ->length(10)
-                ->notNull(false),
-            NotNullVarchar255DatabaseTableColumn::create('status'),
-            TextDatabaseTableColumn::create('message'),
-        ])
-        ->indices([
-            DatabaseTablePrimaryIndex::create()
-                ->columns(['entryID']),
-            DatabaseTableIndex::create('time')
-                ->columns(['time']),
-        ])
-        ->foreignKeys([
-            DatabaseTableForeignKey::create()
-                ->columns(['recipientID'])
-                ->referencedTable('wcf1_user')
-                ->referencedColumns(['userID'])
-                ->onDelete('SET NULL'),
-        ]),
-
-    // This update script was added with 5.3.3. We need to ensure that the change is applied
-    // when someone attempts to upgrade from an older 5.3.x for whatever reason.
-    // If the database already has the proper state this will be a simple noop.
-    //
-    // see: https://github.com/WoltLab/WCF/commit/d836d365d30d44c6140dda17f82b9bd245db03e9
-    PartialDatabaseTable::create('wcf1_event_listener')
-        ->columns([
-            EnumDatabaseTableColumn::create('environment')
-                ->enumValues(['user', 'admin', 'all']),
-        ]),
-
-    DatabaseTable::create('wcf1_flood_control')
-        ->columns([
-            BigintDatabaseTableColumn::create('logID')
-                ->length(20)
-                ->notNull()
-                ->autoIncrement(),
-            NotNullInt10DatabaseTableColumn::create('objectTypeID'),
-            BinaryDatabaseTableColumn::create('identifier')
-                ->length(16)
-                ->notNull(),
-            NotNullInt10DatabaseTableColumn::create('time'),
-        ])
-        ->indices([
-            DatabaseTablePrimaryIndex::create()
-                ->columns(['logID']),
-            DatabaseTableIndex::create()
-                ->columns(['identifier']),
-            DatabaseTableIndex::create()
-                ->columns(['time']),
-        ]),
-
-    PartialDatabaseTable::create('wcf1_page_content')
-        ->columns([
-            TextDatabaseTableColumn::create('metaKeywords')
-                ->drop(),
-        ]),
-
-    PartialDatabaseTable::create('wcf1_user')
-        ->columns([
-            DefaultFalseBooleanDatabaseTableColumn::create('coverPhotoHasWebP'),
-            DefaultFalseBooleanDatabaseTableColumn::create('multifactorActive'),
-        ]),
-
-    PartialDatabaseTable::create('wcf1_user_authentication_failure')
-        ->columns([
-            NotNullVarchar255DatabaseTableColumn::create('validationError')
-                ->defaultValue(''),
-        ]),
-
-    PartialDatabaseTable::create('wcf1_user_avatar')
-        ->columns([
-            DefaultFalseBooleanDatabaseTableColumn::create("hasWebP"),
-        ]),
-
-    PartialDatabaseTable::create('wcf1_user_group')
-        ->columns([
-            DefaultFalseBooleanDatabaseTableColumn::create('requireMultifactor'),
-        ]),
-
-    DatabaseTable::create('wcf1_user_multifactor')
-        ->columns([
-            ObjectIdDatabaseTableColumn::create('setupID'),
-            NotNullInt10DatabaseTableColumn::create('userID'),
-            NotNullInt10DatabaseTableColumn::create('objectTypeID'),
-        ])
-        ->indices([
-            DatabaseTablePrimaryIndex::create()
-                ->columns(['setupID']),
-            DatabaseTableIndex::create()
-                ->type(DatabaseTableIndex::UNIQUE_TYPE)
-                ->columns(['userID', 'objectTypeID']),
-        ])
-        ->foreignKeys([
-            DatabaseTableForeignKey::create()
-                ->columns(['userID'])
-                ->referencedTable('wcf1_user')
-                ->referencedColumns(['userID'])
-                ->onDelete('CASCADE'),
-            DatabaseTableForeignKey::create()
-                ->columns(['objectTypeID'])
-                ->referencedTable('wcf1_object_type')
-                ->referencedColumns(['objectTypeID'])
-                ->onDelete('CASCADE'),
-        ]),
-
-    DatabaseTable::create('wcf1_user_multifactor_backup')
-        ->columns([
-            NotNullInt10DatabaseTableColumn::create('setupID'),
-            NotNullVarchar255DatabaseTableColumn::create('identifier'),
-            NotNullVarchar255DatabaseTableColumn::create('code'),
-            NotNullInt10DatabaseTableColumn::create('createTime'),
-            IntDatabaseTableColumn::create('useTime')
-                ->length(10)
-                ->defaultValue(null),
-        ])
-        ->indices([
-            DatabaseTableIndex::create()
-                ->type(DatabaseTableIndex::UNIQUE_TYPE)
-                ->columns(['setupID', 'identifier']),
-        ])
-        ->foreignKeys([
-            DatabaseTableForeignKey::create()
-                ->columns(['setupID'])
-                ->referencedTable('wcf1_user_multifactor')
-                ->referencedColumns(['setupID'])
-                ->onDelete('CASCADE'),
-        ]),
-
-    DatabaseTable::create('wcf1_user_multifactor_email')
-        ->columns([
-            NotNullInt10DatabaseTableColumn::create('setupID'),
-            NotNullVarchar255DatabaseTableColumn::create('code'),
-            NotNullInt10DatabaseTableColumn::create('createTime'),
-        ])
-        ->indices([
-            DatabaseTableIndex::create()
-                ->type(DatabaseTableIndex::UNIQUE_TYPE)
-                ->columns(['setupID', 'code']),
-        ])
-        ->foreignKeys([
-            DatabaseTableForeignKey::create()
-                ->columns(['setupID'])
-                ->referencedTable('wcf1_user_multifactor')
-                ->referencedColumns(['setupID'])
-                ->onDelete('CASCADE'),
-        ]),
-
-    DatabaseTable::create('wcf1_user_multifactor_totp')
-        ->columns([
-            NotNullInt10DatabaseTableColumn::create('setupID'),
-            NotNullVarchar255DatabaseTableColumn::create('deviceID'),
-            NotNullVarchar255DatabaseTableColumn::create('deviceName'),
-            VarbinaryDatabaseTableColumn::create('secret')
-                ->notNull()
-                ->length(255),
-            NotNullInt10DatabaseTableColumn::create('minCounter'),
-            NotNullInt10DatabaseTableColumn::create('createTime'),
-            IntDatabaseTableColumn::create('useTime')
-                ->length(10)
-                ->notNull(false)
-                ->defaultValue(null),
-        ])
-        ->indices([
-            DatabaseTableIndex::create()
-                ->type(DatabaseTableIndex::UNIQUE_TYPE)
-                ->columns(['setupID', 'deviceID']),
-        ])
-        ->foreignKeys([
-            DatabaseTableForeignKey::create()
-                ->columns(['setupID'])
-                ->referencedTable('wcf1_user_multifactor')
-                ->referencedColumns(['setupID'])
-                ->onDelete('CASCADE'),
-        ]),
-
-    PartialDatabaseTable::create('wcf1_box')
-        ->columns([
-            DefaultFalseBooleanDatabaseTableColumn::create('invertPermissions'),
-        ]),
-
-    PartialDatabaseTable::create('wcf1_page')
-        ->columns([
-            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/update_com.woltlab.wcf_5.4_session_2_user_session.php
deleted file mode 100644 (file)
index e7469ef..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-
-/**
- * Creates the user_session table.
- *
- * @author  Tim Duesterhus
- * @copyright   2001-2020 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package WoltLabSuite\Core
- */
-
-use wcf\system\database\table\column\CharDatabaseTableColumn;
-use wcf\system\database\table\column\IntDatabaseTableColumn;
-use wcf\system\database\table\column\MediumblobDatabaseTableColumn;
-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 = [
-    DatabaseTable::create('wcf1_user_session')
-        ->columns([
-            CharDatabaseTableColumn::create('sessionID')
-                ->length(40)
-                ->notNull(),
-            IntDatabaseTableColumn::create('userID')
-                ->length(10),
-            NotNullVarchar255DatabaseTableColumn::create('userAgent')
-                ->defaultValue(''),
-            VarcharDatabaseTableColumn::create('ipAddress')
-                ->length(39)
-                ->defaultValue(''),
-            NotNullInt10DatabaseTableColumn::create('lastActivityTime')
-                ->defaultValue(0),
-            MediumblobDatabaseTableColumn::create('sessionVariables'),
-        ])
-        ->indices([
-            DatabaseTableIndex::create()
-                ->type(DatabaseTableIndex::PRIMARY_TYPE)
-                ->columns(['sessionID']),
-            DatabaseTableIndex::create()
-                ->columns(['userID']),
-            DatabaseTableIndex::create()
-                ->columns(['lastActivityTime']),
-        ])
-        ->foreignKeys([
-            DatabaseTableForeignKey::create()
-                ->columns(['userID'])
-                ->referencedTable('wcf1_user')
-                ->referencedColumns(['userID'])
-                ->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/update_com.woltlab.wcf_5.4_session_4_drop_virtual.php
deleted file mode 100644 (file)
index afa70f5..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-
-/**
- * Removes the *_session_virtual tables.
- *
- * @author  Tim Duesterhus
- * @copyright   2001-2020 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package WoltLabSuite\Core
- */
-
-use wcf\system\database\table\DatabaseTableChangeProcessor;
-use wcf\system\database\table\PartialDatabaseTable;
-use wcf\system\WCF;
-
-$tables = [
-    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/update_com.woltlab.wcf_5.4_session_5_drop_acp.php
deleted file mode 100644 (file)
index e3c8100..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-/**
- * Removes the wcf1_acp_session table.
- *
- * @author  Tim Duesterhus
- * @copyright   2001-2020 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package WoltLabSuite\Core
- */
-
-use wcf\system\database\table\DatabaseTableChangeProcessor;
-use wcf\system\database\table\PartialDatabaseTable;
-use wcf\system\WCF;
-
-$tables = [
-    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/update_com.woltlab.wcf_5.4_session_6_clean_session.php
deleted file mode 100644 (file)
index 369b494..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-
-/**
- * Adjusts wcf1_acp_session_access_log and wcf1_session.
- *
- * @author  Tim Duesterhus
- * @copyright   2001-2020 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package WoltLabSuite\Core
- */
-
-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 = [
-    PartialDatabaseTable::create('wcf1_acp_session_access_log')
-        ->columns([
-            NotNullVarchar255DatabaseTableColumn::create('requestMethod')
-                ->defaultValue(''),
-        ]),
-    PartialDatabaseTable::create('wcf1_session')
-        ->columns([
-            MediumblobDatabaseTableColumn::create('sessionVariables')->drop(),
-        ]),
-];
-
-(new DatabaseTableChangeProcessor(
-/** @var ScriptPackageInstallationPlugin $this */
-    $this->installation->getPackage(),
-    $tables,
-    WCF::getDB()->getEditor()
-)
-)->process();
index 2cf146b83fc5b73ffff272f5ad10a926dddacedf..28b5b973c33b7f28bdf2ea0fcf113fb20b60a417 100644 (file)
  * @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();
index 2e5c31bbfd76da3a394f4d225aa119c46a196aa5..bd1b46c8f30c9a2f0ec914d24e0bfae111f25e87 100644 (file)
@@ -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();
index 742554fb3ee1d5cc6c9810b61c645b2430cf985f..8d1cfd77ca142c994b3d4c09f7015eb81336f62c 100644 (file)
@@ -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();
index c9ad57aee08585b85bbfc0aa955ce5831930f650..bb2f5267d9eb9c20eb7b541270ba410e66e46e62 100644 (file)
@@ -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();