From: Max Semenik Date: Sun, 2 Oct 2011 06:10:55 +0000 (+0000) Subject: Revert r98355 and r98357; drop the field instead. X-Git-Tag: 1.31.0-rc.0~27324 X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=3a20036ca4b8f40ef1adf60b954afd8f592d8ec6;p=lhc%2Fweb%2Fwiklou.git Revert r98355 and r98357; drop the field instead. --- diff --git a/includes/installer/SqliteUpdater.php b/includes/installer/SqliteUpdater.php index 28f5a9ebea..04b6a31330 100644 --- a/includes/installer/SqliteUpdater.php +++ b/includes/installer/SqliteUpdater.php @@ -64,6 +64,7 @@ class SqliteUpdater extends DatabaseUpdater { array( 'addTable', 'config', 'patch-config.sql' ), array( 'addIndex', 'logging', 'type_action', 'patch-logging-type-action-index.sql'), array( 'doMigrateUserOptions' ), + array( 'dropField', 'user', 'user_options', 'patch-drop-user_options.sql' ), ); } diff --git a/maintenance/sqlite/archives/initial-indexes.sql b/maintenance/sqlite/archives/initial-indexes.sql index 0c0cef8857..c40df11640 100644 --- a/maintenance/sqlite/archives/initial-indexes.sql +++ b/maintenance/sqlite/archives/initial-indexes.sql @@ -41,6 +41,7 @@ CREATE TABLE /*_*/user_tmp ( user_newpassword tinyblob NOT NULL, user_newpass_time binary(14), user_email tinytext NOT NULL, + user_options blob NOT NULL, user_touched binary(14) NOT NULL default '', user_token binary(32) NOT NULL default '', user_email_authenticated binary(14), diff --git a/maintenance/sqlite/archives/patch-drop-user_options.sql b/maintenance/sqlite/archives/patch-drop-user_options.sql new file mode 100644 index 0000000000..1209a97d55 --- /dev/null +++ b/maintenance/sqlite/archives/patch-drop-user_options.sql @@ -0,0 +1,31 @@ +-- Remove user_options field from user table + +CREATE TABLE /*_*/user_tmp ( + user_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + user_name varchar(255) binary NOT NULL default '', + user_real_name varchar(255) binary NOT NULL default '', + user_password tinyblob NOT NULL, + user_newpassword tinyblob NOT NULL, + user_newpass_time binary(14), + user_email tinytext NOT NULL, + user_touched binary(14) NOT NULL default '', + user_token binary(32) NOT NULL default '', + user_email_authenticated binary(14), + user_email_token binary(32), + user_email_token_expires binary(14), + user_registration binary(14), + user_editcount int +) /*$wgDBTableOptions*/; + +INSERT INTO /*_*/user_tmp + SELECT user_id, user_name, user_real_name, user_password, user_newpassword, user_newpass_time, user_email, user_touched, + user_token, user_email_authenticated, user_email_token, user_email_token_expires, user_registration, user_editcount + FROM /*_*/user; + +DROP TABLE /*_*/user; + +ALTER TABLE /*_*/user_tmp RENAME TO /*_*/user; + +CREATE UNIQUE INDEX /*i*/user_name ON /*_*/user (user_name); +CREATE INDEX /*i*/user_email_token ON /*_*/user (user_email_token); +CREATE INDEX /*i*/user_email ON /*_*/user (user_email(50)); diff --git a/tests/phpunit/includes/db/DatabaseSqliteTest.php b/tests/phpunit/includes/db/DatabaseSqliteTest.php index c6c71ced57..5a538150b7 100644 --- a/tests/phpunit/includes/db/DatabaseSqliteTest.php +++ b/tests/phpunit/includes/db/DatabaseSqliteTest.php @@ -196,7 +196,6 @@ class DatabaseSqliteTest extends MediaWikiTestCase { // Mismatches for these columns we can safely ignore $ignoredColumns = array( 'user_newtalk.user_last_timestamp', // r84185 - 'user.user_options', ); $currentDB = new DatabaseSqliteStandalone( ':memory:' ); diff --git a/tests/phpunit/includes/db/sqlite/tables-1.13.sql b/tests/phpunit/includes/db/sqlite/tables-1.13.sql index 523cae7884..66847ab179 100644 --- a/tests/phpunit/includes/db/sqlite/tables-1.13.sql +++ b/tests/phpunit/includes/db/sqlite/tables-1.13.sql @@ -8,6 +8,7 @@ CREATE TABLE /*$wgDBprefix*/user ( user_newpassword tinyblob , user_newpass_time BLOB, user_email tinytext , + user_options blob , user_touched BLOB default '', user_token BLOB default '', user_email_authenticated BLOB, diff --git a/tests/phpunit/includes/db/sqlite/tables-1.15.sql b/tests/phpunit/includes/db/sqlite/tables-1.15.sql index 6a1430ef9e..6b3a628e4e 100644 --- a/tests/phpunit/includes/db/sqlite/tables-1.15.sql +++ b/tests/phpunit/includes/db/sqlite/tables-1.15.sql @@ -10,6 +10,7 @@ CREATE TABLE /*_*/user ( user_newpassword tinyblob NOT NULL, user_newpass_time binary(14), user_email tinytext NOT NULL, + user_options blob NOT NULL, user_touched binary(14) NOT NULL default '', user_token binary(32) NOT NULL default '', user_email_authenticated binary(14), diff --git a/tests/phpunit/includes/db/sqlite/tables-1.16.sql b/tests/phpunit/includes/db/sqlite/tables-1.16.sql index 57894e9482..6e56add238 100644 --- a/tests/phpunit/includes/db/sqlite/tables-1.16.sql +++ b/tests/phpunit/includes/db/sqlite/tables-1.16.sql @@ -10,6 +10,7 @@ CREATE TABLE /*_*/user ( user_newpassword tinyblob NOT NULL, user_newpass_time binary(14), user_email tinytext NOT NULL, + user_options blob NOT NULL, user_touched binary(14) NOT NULL default '', user_token binary(32) NOT NULL default '', user_email_authenticated binary(14), diff --git a/tests/phpunit/includes/db/sqlite/tables-1.17.sql b/tests/phpunit/includes/db/sqlite/tables-1.17.sql index 9719fe9757..69ae376498 100644 --- a/tests/phpunit/includes/db/sqlite/tables-1.17.sql +++ b/tests/phpunit/includes/db/sqlite/tables-1.17.sql @@ -10,6 +10,7 @@ CREATE TABLE /*_*/user ( user_newpassword tinyblob NOT NULL, user_newpass_time binary(14), user_email tinytext NOT NULL, + user_options blob NOT NULL, user_touched binary(14) NOT NULL default '', user_token binary(32) NOT NULL default '', user_email_authenticated binary(14),