List of steps to reproduce (step by step, including full links if applicable):
Try upgrading a PostgreSQL-based MediaWiki installation to 1.37.0:
php update.php
What happens?:
Update script fails with
could not create unique index "wl_user_namespace_title" DETAIL: Key (wl_namespace, wl_title, wl_user)=(0, string omitted, number omitted) is duplicated. Function: PostgresUpdater::changeField Query: ALTER TABLE watchlist ALTER wl_namespace TYPE INT USING 0
The Patch for T286779 is missing in 1.37
column "user_token" of relation "user" contains null values
In our installation the is an Anonymous user without token. I removed this user. Is this correct?
Function: PostgresUpdater::changeField Query: ALTER TABLE "revision" ALTER rev_comment_id TYPE BIGINT USING
[ 'changeField', 'revision', 'rev_comment_id', 'BIGINT', 'DEFAULT 0' ], [ 'changeField', 'revision', 'rev_actor', 'BIGINT', 'DEFAULT 0' ],
This causes the error. DEFAULT 0 is not used before.
A Patch for changeField will be:
if ( strlen( $default ) ) {
$sql .= " USING $default";
}Patch will be submitted.
What should have happened instead?:
Script should have finished execution without errors.
Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc:
MediaWiki 1.36.1 → 1.37.0 (basic schema upgrade).
The PostgresUpdater is not automatically tested?