From: Tim Düsterhus Date: Mon, 3 May 2021 09:35:08 +0000 (+0200) Subject: Reduce the length of MFA VARCHAR columns used in UNIQUE KEY X-Git-Tag: 5.4.0_Alpha_1~13^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ef673d98c862bb3a71d1029815ab200b98575369;p=GitHub%2FWoltLab%2FWCF.git Reduce the length of MFA VARCHAR columns used in UNIQUE KEY Fixes #4171 --- 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 index dbad31b28e..cce1936a7f 100644 --- 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 @@ -16,6 +16,7 @@ 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\NotNullVarchar191DatabaseTableColumn; use wcf\system\database\table\column\NotNullVarchar255DatabaseTableColumn; use wcf\system\database\table\column\ObjectIdDatabaseTableColumn; use wcf\system\database\table\column\TextDatabaseTableColumn; @@ -153,7 +154,7 @@ return [ DatabaseTable::create('wcf1_user_multifactor_backup') ->columns([ NotNullInt10DatabaseTableColumn::create('setupID'), - NotNullVarchar255DatabaseTableColumn::create('identifier'), + NotNullVarchar191DatabaseTableColumn::create('identifier'), NotNullVarchar255DatabaseTableColumn::create('code'), NotNullInt10DatabaseTableColumn::create('createTime'), IntDatabaseTableColumn::create('useTime') @@ -176,7 +177,7 @@ return [ DatabaseTable::create('wcf1_user_multifactor_email') ->columns([ NotNullInt10DatabaseTableColumn::create('setupID'), - NotNullVarchar255DatabaseTableColumn::create('code'), + NotNullVarchar191DatabaseTableColumn::create('code'), NotNullInt10DatabaseTableColumn::create('createTime'), ]) ->indices([ @@ -195,7 +196,7 @@ return [ DatabaseTable::create('wcf1_user_multifactor_totp') ->columns([ NotNullInt10DatabaseTableColumn::create('setupID'), - NotNullVarchar255DatabaseTableColumn::create('deviceID'), + NotNullVarchar191DatabaseTableColumn::create('deviceID'), NotNullVarchar255DatabaseTableColumn::create('deviceName'), VarbinaryDatabaseTableColumn::create('secret') ->notNull() diff --git a/wcfsetup/setup/db/install.sql b/wcfsetup/setup/db/install.sql index 6f6bc13d9f..161555c34a 100644 --- a/wcfsetup/setup/db/install.sql +++ b/wcfsetup/setup/db/install.sql @@ -1722,7 +1722,7 @@ CREATE TABLE wcf1_user_multifactor ( DROP TABLE IF EXISTS wcf1_user_multifactor_backup; CREATE TABLE wcf1_user_multifactor_backup ( setupID INT(10) NOT NULL, - identifier VARCHAR(255) NOT NULL, + identifier VARCHAR(191) NOT NULL, code VARCHAR(255) NOT NULL, createTime INT(10) NOT NULL, useTime INT(10) DEFAULT NULL, @@ -1733,7 +1733,7 @@ CREATE TABLE wcf1_user_multifactor_backup ( DROP TABLE IF EXISTS wcf1_user_multifactor_email; CREATE TABLE wcf1_user_multifactor_email ( setupID INT(10) NOT NULL, - code VARCHAR(255) NOT NULL, + code VARCHAR(191) NOT NULL, createTime INT(10) NOT NULL, UNIQUE KEY (setupID, code) @@ -1742,7 +1742,7 @@ CREATE TABLE wcf1_user_multifactor_email ( DROP TABLE IF EXISTS wcf1_user_multifactor_totp; CREATE TABLE wcf1_user_multifactor_totp ( setupID INT(10) NOT NULL, - deviceID VARCHAR(255) NOT NULL, + deviceID VARCHAR(191) NOT NULL, deviceName VARCHAR(255) NOT NULL, secret VARBINARY(255) NOT NULL, minCounter INT(10) NOT NULL,