Error descripton
maintenance/populateInterwiki.php crashes on Postgres installations by null constraints on iw_api and iw_wikiid
- Mediawiki Master, 1.36.1
- with a PostgreSQL (12) database
the step 'Run the script that populates the sites table:'
php maintenance/populateInterwiki.php
fails with a not-null constraint violation error for the fields
- iw_api
- iw_wikiid
Expected behavior
The script does not fail
Possible fix
in PopulateInterwiki::doPopulate() extend the database insert by empty strings for iw_api and iw_wikiid
if ( !$row ) {
$dbw->insert(
'interwiki',
[
'iw_prefix' => $prefix,
'iw_url' => $d['url'],
'iw_local' => 1,
'iw_api' => '', // FIX??
'iw_wikiid' => '' // FIX??
],
__METHOD__,
[ 'IGNORE' ]
);
}