Umherirrender has uploaded a new change for review. https://gerrit.wikimedia.org/r/96068
Change subject: move page_restrictions.pr_id to top in tables.sql ...................................................................... move page_restrictions.pr_id to top in tables.sql Having the primary key at the top of the column definition looks nicer and helps by finding him. Oracle and Postgres already have this moved up. Change-Id: Id8afbff35e165919f55dfcf1fd1dfaf1805d6aab --- M maintenance/mssql/tables.sql M maintenance/sqlite/archives/initial-indexes.sql M maintenance/tables.sql 3 files changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/68/96068/1 diff --git a/maintenance/mssql/tables.sql b/maintenance/mssql/tables.sql index 7356c38..8a565d5 100644 --- a/maintenance/mssql/tables.sql +++ b/maintenance/mssql/tables.sql @@ -674,13 +674,13 @@ --- Used for storing page restrictions (i.e. protection levels) CREATE TABLE /*$wgDBprefix*/page_restrictions ( + pr_id INT UNIQUE IDENTITY, pr_page INT NOT NULL REFERENCES /*$wgDBprefix*/page(page_id) ON DELETE CASCADE, pr_type NVARCHAR(200) NOT NULL, pr_level NVARCHAR(200) NOT NULL, pr_cascade SMALLINT NOT NULL, pr_user INT NULL, pr_expiry DATETIME NULL, - pr_id INT UNIQUE IDENTITY, CONSTRAINT /*$wgDBprefix*/pr_pagetype PRIMARY KEY(pr_page,pr_type), ); CREATE INDEX /*$wgDBprefix*/pr_page ON /*$wgDBprefix*/page_restrictions(pr_page); diff --git a/maintenance/sqlite/archives/initial-indexes.sql b/maintenance/sqlite/archives/initial-indexes.sql index 1a59be5..954c85d 100644 --- a/maintenance/sqlite/archives/initial-indexes.sql +++ b/maintenance/sqlite/archives/initial-indexes.sql @@ -237,13 +237,13 @@ CREATE TABLE /*_*/page_restrictions_tmp ( + pr_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, pr_page int NOT NULL, pr_type varbinary(60) NOT NULL, pr_level varbinary(60) NOT NULL, pr_cascade tinyint NOT NULL, pr_user int NULL, - pr_expiry varbinary(14) NULL, - pr_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT + pr_expiry varbinary(14) NULL ); CREATE UNIQUE INDEX /*i*/pr_pagetype ON /*_*/page_restrictions_tmp (pr_page,pr_type); diff --git a/maintenance/tables.sql b/maintenance/tables.sql index 53964aa..933ea44 100644 --- a/maintenance/tables.sql +++ b/maintenance/tables.sql @@ -1376,6 +1376,8 @@ -- Used for storing page restrictions (i.e. protection levels) CREATE TABLE /*_*/page_restrictions ( + -- Field for an ID for this restrictions row (sort-key for Special:ProtectedPages) + pr_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, -- Page to apply restrictions to (Foreign Key to page). pr_page int NOT NULL, -- The protection type (edit, move, etc) @@ -1387,9 +1389,7 @@ -- Field for future support of per-user restriction. pr_user int NULL, -- Field for time-limited protection. - pr_expiry varbinary(14) NULL, - -- Field for an ID for this restrictions row (sort-key for Special:ProtectedPages) - pr_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT + pr_expiry varbinary(14) NULL ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/pr_pagetype ON /*_*/page_restrictions (pr_page,pr_type); -- To view, visit https://gerrit.wikimedia.org/r/96068 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id8afbff35e165919f55dfcf1fd1dfaf1805d6aab Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Umherirrender <umherirrender_de...@web.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits