summaryrefslogtreecommitdiff
path: root/www/wiki/maintenance/sqlite/archives/patch-user_properties-fix-pk.sql
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/maintenance/sqlite/archives/patch-user_properties-fix-pk.sql')
-rw-r--r--www/wiki/maintenance/sqlite/archives/patch-user_properties-fix-pk.sql20
1 files changed, 20 insertions, 0 deletions
diff --git a/www/wiki/maintenance/sqlite/archives/patch-user_properties-fix-pk.sql b/www/wiki/maintenance/sqlite/archives/patch-user_properties-fix-pk.sql
new file mode 100644
index 00000000..8362d233
--- /dev/null
+++ b/www/wiki/maintenance/sqlite/archives/patch-user_properties-fix-pk.sql
@@ -0,0 +1,20 @@
+CREATE TABLE /*_*/user_properties_tmp (
+ -- 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(255) NOT NULL,
+
+ -- Property value as a string.
+ up_value blob,
+ PRIMARY KEY (up_user,up_property)
+) /*$wgDBTableOptions*/;
+
+INSERT INTO /*_*/user_properties_tmp
+ SELECT * FROM /*_*/user_properties;
+
+DROP TABLE /*_*/user_properties;
+
+ALTER TABLE /*_*/user_properties_tmp RENAME TO /*_*/user_properties;
+
+CREATE INDEX /*i*/user_properties_property ON /*_*/user_properties (up_property); \ No newline at end of file