r49963 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49962‎ | r49963 | r49964 >
Date:17:15, 27 April 2009
Author:brion
Status:ok
Tags:
Comment:
* Update patch-user_properties.sql to match definition in tables.sql
* Add some doc comments on user_properties table def and move it up near the user tales
Modified paths:
  • /trunk/phase3/maintenance/archives/patch-user_properties.sql (modified) (history)
  • /trunk/phase3/maintenance/tables.sql (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/archives/patch-user_properties.sql
@@ -1,8 +1,20 @@
2 -
 2+--
 3+-- User preferences and perhaps other fun stuff. :)
 4+-- Replaces the old user.user_options blob, with a couple nice properties:
 5+--
 6+-- 1) We only store non-default settings, so changes to the defauls
 7+-- are now reflected for everybody, not just new accounts.
 8+-- 2) We can more easily do bulk lookups, statistics, or modifications of
 9+-- saved options since it's a sane table structure.
 10+--
311 CREATE TABLE /*_*/user_properties(
4 - up_user bigint not null,
 12+ -- Foreign key to user.user_id
 13+ up_user int not null,
 14+
 15+ -- Name of the option being saved. This is indexed for bulk lookup.
516 up_property varbinary(32) not null,
 17+
 18+ -- Property value as a string.
619 up_value blob
720 ) /*$wgDBTableOptions*/;
821
Index: trunk/phase3/maintenance/tables.sql
@@ -86,7 +86,8 @@
8787
8888 -- Newline-separated list of name=value defining the user
8989 -- preferences
90 - -- Now obsolete in favour of user_properties table.
 90+ -- Now obsolete in favour of user_properties table;
 91+ -- old values will be migrated from here transparently.
9192 user_options blob NOT NULL,
9293
9394 -- This is a timestamp which is updated when a user
@@ -161,8 +162,10 @@
162163 CREATE INDEX /*i*/ug_group ON /*_*/user_groups (ug_group);
163164
164165
 166+--
165167 -- Stores notifications of user talk page changes, for the display
166168 -- of the "you have new messages" box
 169+--
167170 CREATE TABLE /*_*/user_newtalk (
168171 -- Key to user.user_id
169172 user_id int NOT NULL default 0,
@@ -180,6 +183,29 @@
181184
182185
183186 --
 187+-- User preferences and perhaps other fun stuff. :)
 188+-- Replaces the old user.user_options blob, with a couple nice properties:
 189+--
 190+-- 1) We only store non-default settings, so changes to the defauls
 191+-- are now reflected for everybody, not just new accounts.
 192+-- 2) We can more easily do bulk lookups, statistics, or modifications of
 193+-- saved options since it's a sane table structure.
 194+--
 195+CREATE TABLE /*_*/user_properties(
 196+ -- Foreign key to user.user_id
 197+ up_user int not null,
 198+
 199+ -- Name of the option being saved. This is indexed for bulk lookup.
 200+ up_property varbinary(32) not null,
 201+
 202+ -- Property value as a string.
 203+ up_value blob
 204+) /*$wgDBTableOptions*/;
 205+
 206+CREATE UNIQUE INDEX /*i*/user_properties_user_property on /*_*/user_properties (up_user,up_property);
 207+CREATE INDEX /*i*/user_properties_property on /*_*/user_properties (up_property);
 208+
 209+--
184210 -- Core of the wiki: each page has an entry here which identifies
185211 -- it by title and contains some essential metadata.
186212 --
@@ -1252,7 +1278,8 @@
12531279 CREATE INDEX /*i*/change_tag_tag_id ON /*_*/change_tag (ct_tag,ct_rc_id,ct_rev_id,ct_log_id);
12541280
12551281
 1282+-- Rollup table to pull a LIST of tags simply without ugly GROUP_CONCAT
 1283+-- that only works on MySQL 4.1+
12561284 CREATE TABLE /*_*/tag_summary (
12571285 ts_rc_id int NULL,
12581286 ts_log_id int NULL,
@@ -1269,13 +1296,4 @@
12701297 vt_tag varchar(255) NOT NULL PRIMARY KEY
12711298 ) /*$wgDBTableOptions*/;
12721299
1273 -CREATE TABLE /*_*/user_properties(
1274 - up_user int not null,
1275 - up_property varbinary(32) not null,
1276 - up_value blob
1277 -) /*$wgDBTableOptions*/;
1278 -
1279 -CREATE UNIQUE INDEX /*i*/user_properties_user_property on /*_*/user_properties (up_user,up_property);
1280 -CREATE INDEX /*i*/user_properties_property on /*_*/user_properties (up_property);
1281 -
12821300 -- vim: sw=2 sts=2 et

Status & tagging log