addRFCandPMIDInterwiki: Fix strict mode errors
authorKunal Mehta <legoktm@member.fsf.org>
Sat, 15 Oct 2016 19:26:45 +0000 (12:26 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Sat, 15 Oct 2016 19:26:45 +0000 (12:26 -0700)
Those columns have no defaults and cause errors if MySQL strict mode is
enabled.

Also make this maintenance script runnable standalone.

Bug: T147536
Change-Id: I0f0ba6fc4375c44b71852c5c2dad8336db17c479

maintenance/addRFCandPMIDInterwiki.php

index 9740ef2..2262338 100644 (file)
@@ -63,7 +63,10 @@ class AddRFCAndPMIDInterwiki extends LoggedUpdateMaintenance {
                                [ 'iw_prefix' ],
                                [
                                        'iw_prefix' => 'rfc',
-                                       'iw_url' => 'https://tools.ietf.org/html/rfc$1'
+                                       'iw_url' => 'https://tools.ietf.org/html/rfc$1',
+                                       'iw_api' => '',
+                                       'iw_wikiid' => '',
+                                       'iw_local' => 0,
                                ],
                                __METHOD__
                        );
@@ -74,6 +77,9 @@ class AddRFCAndPMIDInterwiki extends LoggedUpdateMaintenance {
                        [
                                'iw_prefix' => 'pmid',
                                'iw_url' => 'https://www.ncbi.nlm.nih.gov/pubmed/$1?dopt=Abstract',
+                               'iw_api' => '',
+                               'iw_wikiid' => '',
+                               'iw_local' => 0,
                        ],
                        __METHOD__,
                        // If there's already a pmid interwiki link, don't
@@ -84,3 +90,6 @@ class AddRFCAndPMIDInterwiki extends LoggedUpdateMaintenance {
                return true;
        }
 }
+
+$maintClass = 'AddRFCAndPMIDInterwiki';
+require_once RUN_MAINTENANCE_IF_MAIN;