Drop unused database field ss_admins
authorumherirrender <umherirrender_de.wp@web.de>
Sat, 22 Sep 2012 23:05:07 +0000 (01:05 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Sat, 29 Sep 2012 10:20:21 +0000 (12:20 +0200)
no longer updated since 1.5

Change-Id: Iebdce084d178b5003105b2d2b7dcc499c274ff56

includes/installer/MysqlUpdater.php
includes/installer/SqliteUpdater.php
maintenance/archives/patch-drop-ss_admins.sql [new file with mode: 0644]
maintenance/sqlite/archives/patch-drop-ss_admins.sql [new file with mode: 0644]
maintenance/tables.sql

index 08307af..037af7b 100644 (file)
@@ -216,6 +216,7 @@ class MysqlUpdater extends DatabaseUpdater {
                        array( 'dropField', 'category',     'cat_hidden',       'patch-cat_hidden.sql' ),
 
                        // 1.21
+                       array( 'dropField', 'site_stats',   'ss_admins',        'patch-drop-ss_admins.sql' ),
                );
        }
 
index aedc5c7..8813b85 100644 (file)
@@ -95,6 +95,7 @@ class SqliteUpdater extends DatabaseUpdater {
                        array( 'dropField', 'category',     'cat_hidden',       'patch-cat_hidden.sql' ),
 
                        // 1.21
+                       array( 'dropField', 'site_stats',   'ss_admins',        'patch-drop-ss_admins.sql' ),
                );
        }
 
diff --git a/maintenance/archives/patch-drop-ss_admins.sql b/maintenance/archives/patch-drop-ss_admins.sql
new file mode 100644 (file)
index 0000000..13c3d3b
--- /dev/null
@@ -0,0 +1,2 @@
+-- field is deprecated and no longer updated as of 1.5
+ALTER TABLE /*_*/site_stats DROP COLUMN ss_admins;
\ No newline at end of file
diff --git a/maintenance/sqlite/archives/patch-drop-ss_admins.sql b/maintenance/sqlite/archives/patch-drop-ss_admins.sql
new file mode 100644 (file)
index 0000000..9951e17
--- /dev/null
@@ -0,0 +1,22 @@
+-- field is deprecated and no longer updated as of 1.5
+CREATE TABLE /*_*/site_stats_tmp (
+  ss_row_id int unsigned NOT NULL,
+  ss_total_views bigint unsigned default 0,
+  ss_total_edits bigint unsigned default 0,
+  ss_good_articles bigint unsigned default 0,
+  ss_total_pages bigint default '-1',
+  ss_users bigint default '-1',
+  ss_active_users bigint default '-1',
+  ss_images int default 0
+) /*$wgDBTableOptions*/;
+
+INSERT INTO /*_*/site_stats_tmp
+       SELECT ss_row_id, ss_total_views, ss_total_edits, ss_good_articles,
+               ss_total_pages, ss_users, ss_active_users, ss_images
+               FROM /*_*/site_stats;
+
+DROP TABLE /*_*/site_stats;
+
+ALTER TABLE /*_*/site_stats_tmp RENAME TO /*_*/site_stats;
+
+CREATE UNIQUE INDEX /*i*/ss_row_id ON /*_*/site_stats (ss_row_id);
\ No newline at end of file
index 062052f..1ddc89d 100644 (file)
@@ -689,9 +689,6 @@ CREATE TABLE /*_*/site_stats (
   -- Number of users that still edit
   ss_active_users bigint default '-1',
 
-  -- Deprecated, no longer updated as of 1.5
-  ss_admins int default '-1',
-
   -- Number of images, equivalent to SELECT COUNT(*) FROM image
   ss_images int default 0
 ) /*$wgDBTableOptions*/;