Add missing subjectspace pages to watchlist on update.
authorBrian Wolff <bawolff+wn@gmail.com>
Mon, 2 Dec 2013 19:30:40 +0000 (15:30 -0400)
committerBrian Wolff <bawolff+wn@gmail.com>
Mon, 2 Dec 2013 19:31:13 +0000 (19:31 +0000)
Previously this only fixed the other direction, if a talk page
was missing, but it still complained for missing subject pages.

Discovered by Joergi on irc

Change-Id: I439eb0c4a74260157f9542470f01f189fe9081c5

includes/installer/MysqlUpdater.php

index cc5313a..ffa4900 100644 (file)
@@ -390,6 +390,16 @@ class MysqlUpdater extends DatabaseUpdater {
                                'wl_notificationtimestamp' => 'wl_notificationtimestamp'
                        ), array( 'NOT (wl_namespace & 1)' ), __METHOD__, 'IGNORE' );
                $this->output( "done.\n" );
+
+               $this->output( "Adding missing watchlist subject page rows... " );
+               $this->db->insertSelect( 'watchlist', 'watchlist',
+                       array(
+                               'wl_user' => 'wl_user',
+                               'wl_namespace' => 'wl_namespace & ~1',
+                               'wl_title' => 'wl_title',
+                               'wl_notificationtimestamp' => 'wl_notificationtimestamp'
+                       ), array( 'wl_namespace & 1' ), __METHOD__, 'IGNORE' );
+               $this->output( "done.\n" );
        }
 
        function doSchemaRestructuring() {