X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Farchives%2Fpatch-user_properties.sql;h=85b00616ada5404558b470dcb152723a3aa832bf;hb=8a5b362c435a054918a2392bc9d470ff85992022;hp=41c63496a0d5813ac4a8f35b68ff13b4e4d9a66d;hpb=155ddf6de4a2aa68dcdd8ca7d0f9db21ced4b228;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/archives/patch-user_properties.sql b/maintenance/archives/patch-user_properties.sql index 41c63496a0..85b00616ad 100644 --- a/maintenance/archives/patch-user_properties.sql +++ b/maintenance/archives/patch-user_properties.sql @@ -1,10 +1,22 @@ --- Table for holding user properties. - +-- +-- User preferences and perhaps other fun stuff. :) +-- Replaces the old user.user_options blob, with a couple nice properties: +-- +-- 1) We only store non-default settings, so changes to the defauls +-- are now reflected for everybody, not just new accounts. +-- 2) We can more easily do bulk lookups, statistics, or modifications of +-- saved options since it's a sane table structure. +-- CREATE TABLE /*_*/user_properties( - up_user bigint not null, + -- Foreign key to user.user_id + up_user int not null, + + -- Name of the option being saved. This is indexed for bulk lookup. up_property varbinary(32) not null, + + -- Property value as a string. up_value blob ) /*$wgDBTableOptions*/; -CREATE UNIQUE INDEX /*i*/user_properties_user_property on user_properties (up_user,up_property); -CREATE INDEX /*i*/user_properties_property on user_properties (up_property); +CREATE UNIQUE INDEX /*i*/user_properties_user_property on /*_*/user_properties (up_user,up_property); +CREATE INDEX /*i*/user_properties_property on /*_*/user_properties (up_property);