X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/mediawiki.git/blobdiff_plain/19e297c21b10b1b8a3acad5e73fc71dcb35db44a..6932310fd58ebef145fa01eb76edf7150284d8ea:/maintenance/sqlite/archives/patch-user_groups-ug_expiry.sql

diff --git a/maintenance/sqlite/archives/patch-user_groups-ug_expiry.sql b/maintenance/sqlite/archives/patch-user_groups-ug_expiry.sql
new file mode 100644
index 00000000..7fc89416
--- /dev/null
+++ b/maintenance/sqlite/archives/patch-user_groups-ug_expiry.sql
@@ -0,0 +1,21 @@
+DROP TABLE IF EXISTS /*_*/user_groups_tmp;
+
+CREATE TABLE /*$wgDBprefix*/user_groups_tmp (
+  ug_user int unsigned NOT NULL default 0,
+  ug_group varbinary(255) NOT NULL default '',
+  ug_expiry varbinary(14) NULL default NULL,
+  PRIMARY KEY (ug_user, ug_group)
+);
+
+INSERT OR IGNORE INTO /*_*/user_groups_tmp (
+    ug_user, ug_group )
+    SELECT
+    ug_user, ug_group
+    FROM /*_*/user_groups;
+
+DROP TABLE /*_*/user_groups;
+
+ALTER TABLE /*_*/user_groups_tmp RENAME TO /*_*/user_groups;
+
+CREATE INDEX /*i*/ug_group ON /*_*/user_groups (ug_group);
+CREATE INDEX /*i*/ug_expiry ON /*_*/user_groups (ug_expiry);
