List of steps to reproduce (step by step, including full links if applicable):
- $wgDBtype = "postgres"
- Upgrading from a previous version of Mediawiki to 1.35.5
- Run php maintenance/update.php
- Missing ipb_sitewide, run php sql.php maintenance/patch-ipb_sitewide.sql
What happens?:
Running update.php does not run patch-ipb_sitewide.sql, update.php reports missing columb ipb_sitewide
When manually running php sql.php patch-ipb_sitewide.sql, error is ERROR: column "ipb_sitewide" is of type boolean but default expression is of type integer
What should have happened instead?
update.php should run all patch scripts in postgres equivalent language
Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.:
Mediawiki 1.35.5
Postgres 10.6
PHP 7.4.27
Postgres Table before upgrade:
Table "mediawiki.ipblocks" Column | Type | Collation | Nullable | Default | Storage | Stats target | Description ----------------------+--------------------------+-----------+----------+------------------------------------------+----------+--------------+------------- ipb_id | integer | | not null | nextval('ipblocks_ipb_id_seq'::regclass) | plain | | ipb_address | text | | | | extended | | ipb_user | integer | | | | plain | | ipb_by | integer | | not null | 0 | plain | | ipb_by_text | text | | not null | ''::text | extended | | ipb_reason | text | | not null | ''::text | extended | | ipb_timestamp | timestamp with time zone | | not null | | plain | | ipb_auto | smallint | | not null | 0 | plain | | ipb_anon_only | smallint | | not null | 0 | plain | | ipb_create_account | smallint | | not null | 1 | plain | | ipb_enable_autoblock | smallint | | not null | 1 | plain | | ipb_expiry | timestamp with time zone | | not null | | plain | | ipb_range_start | text | | | | extended | | ipb_range_end | text | | | | extended | | ipb_deleted | smallint | | not null | 0 | plain | | ipb_block_email | smallint | | not null | 0 | plain | | ipb_allow_usertalk | smallint | | not null | 0 | plain | | ipb_parent_block_id | integer | | | | plain | | ipb_reason_id | integer | | not null | 0 | plain | | ipb_by_actor | integer | | not null | 0 | plain | | Indexes: "ipblocks_pkey" PRIMARY KEY, btree (ipb_id) "ipb_address_unique" UNIQUE, btree (ipb_address, ipb_user, ipb_auto, ipb_anon_only) "ipb_parent_block_id" btree (ipb_parent_block_id) "ipb_range" btree (ipb_range_start, ipb_range_end) "ipb_user" btree (ipb_user) Foreign-key constraints: "ipblocks_ipb_by_fkey" FOREIGN KEY (ipb_by) REFERENCES mwuser(user_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED "ipblocks_ipb_parent_block_id_fkey" FOREIGN KEY (ipb_parent_block_id) REFERENCES ipblocks(ipb_id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED "ipblocks_ipb_user_fkey" FOREIGN KEY (ipb_user) REFERENCES mwuser(user_id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED Referenced by: TABLE "ipblocks" CONSTRAINT "ipblocks_ipb_parent_block_id_fkey" FOREIGN KEY (ipb_parent_block_id) REFERENCES ipblocks(ipb_id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED