* (bug 32470) Increase the length of ug_group

Postgres doesn't need extending...
This commit is contained in:
Sam Reed 2011-11-19 16:26:28 +00:00
parent 7fa9b4cf40
commit c6b3c2f05b
9 changed files with 42 additions and 4 deletions

View file

@ -22,6 +22,7 @@ production.
ImageMagick.
* Introduced $wgQueryPageDefaultLimit (defaults to 50) for the number of
items to show by default on query pages (special pages such as Whatlinkshere).
* (bug 32470) Increase the length of ug_group
=== New features in 1.19 ===
* (bug 19838) Possibility to get all interwiki prefixes if the interwiki
@ -141,7 +142,7 @@ production.
* (bug 32168) Add wfAssembleUrl for use in wfExpandUrl
* (bug 32168) fixed - wfExpandUrl expands dot segments now
* (bug 31535) Upload comments now truncated properly, and don't have brackets
* (bug 32450) Scripts pages in MediaWiki: namespace parse [[Category:#]] links
* (bug 32450) Scripts pages in MediaWiki: namespace parse [[Category:#]] links
* (bug 32086) Special:PermanentLink now show an error message when no subpage
was specified.

View file

@ -666,4 +666,18 @@ abstract class DatabaseUpdater {
$cl->execute();
$this->output( "Rebuilding localisation cache done.\n" );
}
/**
* Increases the length of the user_group field
*/
protected function doIncreaseUserGroupLength() {
$this->output( 'Increasing the length of the user_group...' );
if ( $this->updateRowExists( 'user_groups_length' ) ) {
$this->output( "...user_groups field is already long enough.\n" );
return;
}
$this->applyPatch( 'patch-ug_group-length-increase.sql' );
$this->insertUpdateRow( 'user_groups_length' );
$this->output( "done.\n" );
}
}

View file

@ -189,7 +189,8 @@ class MysqlUpdater extends DatabaseUpdater {
array( 'dropField', 'user', 'user_options', 'patch-drop-user_options.sql' ),
array( 'addField', 'revision', 'rev_sha1', 'patch-rev_sha1.sql' ),
array( 'addField', 'archive', 'ar_sha1', 'patch-ar_sha1.sql' ),
array( 'addIndex', 'page', 'page_redirect_namespace_len', 'patch-page_redirect_namespace_len.sql' )
array( 'addIndex', 'page', 'page_redirect_namespace_len', 'patch-page_redirect_namespace_len.sql' ),
array( 'doIncreaseUserGroupLength' ),
);
}

View file

@ -47,6 +47,7 @@ class OracleUpdater extends DatabaseUpdater {
array( 'addField', 'archive', 'ar_sha1', 'patch-ar_sha1_field.sql' ),
array( 'doRemoveNotNullEmptyDefaults2' ),
array( 'addIndex', 'page', 'i03', 'patch-page_redirect_namespace_len.sql' ),
array( 'doIncreaseUserGroupLength' ),
// till 2.0 i guess
array( 'doRebuildDuplicateFunction' ),

View file

@ -67,7 +67,8 @@ class SqliteUpdater extends DatabaseUpdater {
array( 'dropField', 'user', 'user_options', 'patch-drop-user_options.sql' ),
array( 'addField', 'revision', 'rev_sha1', 'patch-rev_sha1.sql' ),
array( 'addField', 'archive', 'ar_sha1', 'patch-ar_sha1.sql' ),
array( 'addIndex', 'page', 'page_redirect_namespace_len', 'patch-page_redirect_namespace_len.sql' )
array( 'addIndex', 'page', 'page_redirect_namespace_len', 'patch-page_redirect_namespace_len.sql' ),
array( 'doIncreaseUserGroupLength' ),
);
}

View file

@ -0,0 +1,2 @@
ALTER TABLE /*_*/user_groups
MODIFY COLUMN ug_group varbinary(32) NOT NULL default '';

View file

@ -0,0 +1,3 @@
define mw_prefix='{$wgDBprefix}';
ALTER TABLE &mw_prefix.user_groups MODIFY ug_group VARCHAR2(32) NOT NULL;

View file

@ -0,0 +1,15 @@
CREATE TABLE /*_*/user_groups_tmp (
ug_user int unsigned NOT NULL default 0,
ug_group varbinary(32) NOT NULL default ''
) /*$wgDBTableOptions*/;
INSERT INTO /*_*/user_groups_tmp
SELECT ug_user, ug_group
FROM /*_*/user_groups;
DROP TABLE /*_*/user_groups;
ALTER TABLE /*_*/user_groups_tmp RENAME TO /*_*/user_groups;
CREATE UNIQUE INDEX /*i*/ug_user_group ON /*_*/user_groups (ug_user,ug_group);
CREATE INDEX /*i*/ug_group ON /*_*/user_groups (ug_group);

View file

@ -152,7 +152,7 @@ CREATE TABLE /*_*/user_groups (
-- with particular permissions. A user will have the combined
-- permissions of any group they're explicitly in, plus
-- the implicit '*' and 'user' groups.
ug_group varbinary(16) NOT NULL default ''
ug_group varbinary(32) NOT NULL default ''
) /*$wgDBTableOptions*/;
CREATE UNIQUE INDEX /*i*/ug_user_group ON /*_*/user_groups (ug_user,ug_group);