<!-- 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. -->
<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>
--- /dev/null
+<?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'),
+ ]),
+];
--- /dev/null
+<?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'),
+ ]),
+];
--- /dev/null
+<?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(),
+];
--- /dev/null
+<?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(),
+];
--- /dev/null
+<?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(),
+ ]),
+];
+++ /dev/null
-<?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();
+++ /dev/null
-<?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();
+++ /dev/null
-<?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();
+++ /dev/null
-<?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();
+++ /dev/null
-<?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();
* @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()
->drop(),
]),
];
-
-(new DatabaseTableChangeProcessor(
- /** @var ScriptPackageInstallationPlugin $this */
- $this->installation->getPackage(),
- $tables,
- WCF::getDB()->getEditor()
-))->process();
* @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()
->drop(),
]),
];
-
-(new DatabaseTableChangeProcessor(
- /** @var ScriptPackageInstallationPlugin $this */
- $this->installation->getPackage(),
- $tables,
- WCF::getDB()->getEditor()
-))->process();
* @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()
->columns(['objectTypeID', 'objectID', 'tagID']),
]),
];
-
-(new DatabaseTableChangeProcessor(
- /** @var ScriptPackageInstallationPlugin $this */
- $this->installation->getPackage(),
- $tables,
- WCF::getDB()->getEditor()
-))->process();
* @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()
->columns(['tagID']),
]),
];
-
-(new DatabaseTableChangeProcessor(
- /** @var ScriptPackageInstallationPlugin $this */
- $this->installation->getPackage(),
- $tables,
- WCF::getDB()->getEditor()
-))->process();