Commit graph

9265 commits

Author SHA1 Message Date
Reedy
9ee7179d15 Remove some checks for extension_loaded( 'intl' )
ext-intl is required by MW now, so composer will enforce requirement

Bug: T267669
Change-Id: I6fcc19e06b95e58def4364a24b8de100dd6f3f90
2020-11-29 00:06:32 +00:00
Umherirrender
0aee2cd724 Add some int casts for queries in maintenance scripts
all places detected as SecurityCheck-SQLInjection by
mediawiki/phan-taint-check-plugin 3.1.0

Bug: T216348
Change-Id: Ifd9589e8da996a0017b4361c62830e597c41f10e
2020-11-27 18:43:40 +01:00
jenkins-bot
ea77501778 Merge "Fix strange formatting issues in Postgres schema sql" 2020-11-26 21:33:54 +00:00
Ahmon Dancy
815def7ae2 Add flag to rebuildLocalisationCache.php to skip MessageBlobStore clear
maintenance/rebuildLocalisationCache now accepts a
--no-clear-message-blob-store option to skip the call to
MessageBlobStore::clearGlobalCacheEntry() when a language file has
been rebuilt.

Bug: T268698
Change-Id: I0907b51149402ad60e924d17e6ef9d0084e8c2cc
2020-11-24 15:42:38 -08:00
Ammar Abdulhamid
b922a292c9 Fix strange formatting issues in Postgres schema sql
Mere presence of partial index's WHERE clause is disrupting anything
that comes after it leading to strange and non-uniform formatting

Change-Id: I068113b3026d6c3422348e86b3048234b905bb1d
2020-11-24 11:47:18 +01:00
jenkins-bot
4c79a1487b Merge "tables.json: Convert space indents to tabs for page_props" 2020-11-24 04:23:12 +00:00
Reedy
494543f8f8 tables.json: Convert space indents to tabs for page_props
Change-Id: Ic1a7bfc7847ce3c7826d62582836a228a017cb31
2020-11-24 03:32:35 +00:00
Reedy
a93f7efc05 generateSchemaSql.php: Handle invalid json files
Change-Id: I445da0a53e3883b853510338ba4061eb03510fa5
2020-11-24 02:39:10 +00:00
Ammar Abdulhamid
b7f35505d0 Fix some PG page table indexes drift with MySQL
There are many changes in migrating page to abstract schema,
so I split this out to simplify it a bit.

 - Rename index: page_len_idx -> page_len
 - Rename index: page_random_idx -> page_random
 - Rename index: page_unique_name -> name_title
 - Add index: page_redirect_namespace_len

Bug: T164898
Change-Id: I8193860129f1134f5dad7d633d069077ee597465
2020-11-23 07:21:21 +01:00
Ammar Abdulhamid
47866ff813 Fix formatting issues and grammar in json of abstract schema
Change-Id: Ibe8aa57bac2b2d46f1b03bfdc728800ee9954441
2020-11-22 07:07:52 +00:00
jenkins-bot
388bdaf771 Merge "Migrate slot_roles and content_models to abstract schema" 2020-11-22 06:16:23 +00:00
jenkins-bot
627c3c8bc8 Merge "Add patch to set wl_notificationtimestamp BINARY(14)" 2020-11-22 00:10:02 +00:00
Amir Sarabadani
a2a0088d6b Migrate slot_roles and content_models to abstract schema
These tables don't have drift between MySQL and Postgres but their
primary keys don't have explicit "NOT NULL" statement making them
nullable in sqlite. Fixing this drift.

Also changing the PK fields of these two tables from smallint to int,
given that PG would be complicated with smallint auto_increment PKs

Bug: T230428
Bug: T258366
Change-Id: Icf6ce044eaf0f09b1a2bdd8a1f618cef1e0415bf
2020-11-22 00:24:08 +01:00
jenkins-bot
73ff70c7fb Merge "Migrate job to abstract schema" 2020-11-21 23:02:44 +00:00
jenkins-bot
419bf55c2d Merge "Fix trailing ; in patch-sites-site_language-35.sql" 2020-11-21 22:55:28 +00:00
Amir Sarabadani
01d8de358f Add patch to set wl_notificationtimestamp BINARY(14)
This is follow up to Ie996b81ca59 that changed type of this field from
varbinary(14) to binary(14) as part of standardizing timestamp fields
but didn't add the patch.

Bug: T230428
Bug: T42626
Change-Id: I554899f729594c7064633459ab5a6be48920e131
2020-11-21 23:47:34 +01:00
Ammar Abdulhamid
40ebc05ce4 Migrate job to abstract schema
Postgres:
 - Drop deafault from job_id
 - Add default to job_cmd
 - Change job_namespace datatype to INTEGER
 - Drop  job_cmd_namespace_title index
 - Add job_cmd index on the same fields as MySQL
 - Rename index job_timestamp_idx

MySQL:
 - Change job_title datatype to VARBINARY
 - Change job_timestamp datatype to BINARY (mwtimestamp)
 - Change job_token_timestamp datatype to BINARY (mwtimestamp)

Bug: T230428
Bug: T164898
Bug: T42626
Change-Id: I207aefc48c7bcbb5b5362af4b63d9a1383019a6d
2020-11-21 23:38:28 +01:00
Reedy
51c99a1fa7 Fix trailing ; in patch-sites-site_language-35.sql
Change-Id: I537197fcaf54870de843a0798e413296f32740ef
Follows-Up: I95bef3ef279cb59d54a3127c646a03826fa0da6b
2020-11-21 22:30:51 +00:00
Amir Sarabadani
69d7bf0cfe Fix un_user_ip index column
This happened during the abstraction (Idc3ded012890d).
Given that the patch was merged recently,
I don't think we need database patches for it.

Bug: T230428
Change-Id: Ia8c529bc502ed1674476f71f67c80003a2ae83cf
2020-11-21 23:07:26 +01:00
jenkins-bot
3a2708bf94 Merge "Inject services into SpecialAllMessages" 2020-11-20 19:07:30 +00:00
Ammar Abdulhamid
b9717c8bf8 Migrate page_props to abstract schema
For Postges:
 - Drop foreign key from 'pp_page'
 - Move pk addition from the SQL file to the Updater class
 - Override default SQL value for float to return FLOAT which is in use.

For MySQL:
 - Override default SQL value for float to return FLOAT which is in use
 Hack added in generateSchemaSql.php

Bug: T230428
Bug: T164898
Change-Id: I3c591c9b8f43647b0208690bca79f2d0dd206922
2020-11-18 06:20:32 +01:00
Reedy
024f4305bc Add table prefix to patch-ipblocks_restrictions-ir_type.sql
Change-Id: I85a3c2139a1e4a217925eb13d127e237c575d7bd
Follows-Up: I48894c0de13ac599a8c932c5dec091a39fd14bbf
2020-11-17 22:53:49 +00:00
Amir Sarabadani
db4315b942 Rename namespace_title index on watchlist to wl_namespace_title
Indexes need to have prefixes, to avoid clashes in several RDBMSes where
indexes are global

Bug: T266228
Change-Id: I96a04903f6123d1fb8081fcf15cdd1f29708d320
2020-11-16 15:24:24 +01:00
Amir Sarabadani
5ed40a2c1d Increase size of ipblocks_restrictions.ir_type
The number actually doesn't matter and it's only the width of response
(and it'll be dropped in future releases of MySQL) but since production
is set to tinyint(4), making these two in sync to reduce noise in drift
report.

Bug: T265321
Change-Id: I48894c0de13ac599a8c932c5dec091a39fd14bbf
2020-11-16 14:58:29 +01:00
jenkins-bot
d009d75c73 Merge "Start generateSchemaChangeSql.php" 2020-11-16 08:40:36 +00:00
jenkins-bot
61d05973bf Merge "Replace deprecated WikiPage::factory/newFromID in maintenance scripts" 2020-11-15 02:24:19 +00:00
jenkins-bot
6415fd72a1 Merge "Replace deprecated Title::getCdnUrls" 2020-11-13 08:22:53 +00:00
jenkins-bot
4acef2dd82 Merge "Improve docs about @param/@return object $row to stdClass" 2020-11-13 08:10:03 +00:00
Umherirrender
b152c9a66e Fix docs in GenerateSitemap
Change-Id: I8fd5b4a8e89f8546e6f03c2d45494e24f4f9f31d
2020-11-13 00:16:01 +01:00
Umherirrender
9fb6d107ba Improve docs about @param/@return object $row to stdClass
Change-Id: I743d992db703f2b46b6e3abf80c14d026c6599f4
2020-11-13 00:08:21 +01:00
Umherirrender
a3194f2194 Replace deprecated WikiPage::factory/newFromID in maintenance scripts
Change-Id: I5b2d4313f986484368da9b63c9a19892c2328dae
2020-11-12 21:48:21 +00:00
jenkins-bot
dbb75bc879 Merge "Convert some patch files to use internal updater functions" 2020-11-12 19:21:48 +00:00
Thiemo Kreuz
20b2c5000d Make use of array deconstruction directly in foreach, if possible
Deconstructing non-sparse, numerically indexed arrays directly in
foreach (a.k.a. using the list() syntax in foreach) is possible since
PHP 5.5.

The possibility to use string array keys as well as non-sequential
numeric keys in array deconstruction was added in PHP 7.1.

Change-Id: I56a48552a45f61cedc291b306cad8548fc70d485
2020-11-12 18:38:06 +00:00
Ammar Abdulhamid
5ac66860b4 Convert some patch files to use internal updater functions
Change-Id: I6fd3830bc54e5572736b2c94737015b8176881de
2020-11-12 05:23:58 +01:00
jenkins-bot
8e4b3653a5 Merge "Migrate revision_actor_temp to abstract schema" 2020-11-12 00:23:38 +00:00
Thiemo Kreuz
6f901ef17c Make use of native array_column() function where possible
Change-Id: I78108e7dc5a10d892e97b0101c1b72cb8d363e97
2020-11-11 22:48:53 +00:00
Ammar Abdulhamid
5db104f6a1 MysqlUpdater: Add utility functions to alter default constraint
There's occassionaly a need to alter default constraints, currently
a separate patch file is required to do so everytime which is quite
onerous and can be simplified.

Borrow a pair of set/drop functions from PostgresUpdater to make the
process more efficient.

Also convert usages of patch files to use the methods.

Change-Id: I846b94d0a721295f5bcdfe21f658116704e2d350
2020-11-11 05:47:51 +00:00
jenkins-bot
d0e2f202d5 Merge "importTextFiles.php: Replace deprecated WikiRevision:setText()" 2020-11-11 00:39:48 +00:00
Ammar Abdulhamid
16ebaa8ce4 Migrate revision_actor_temp to abstract schema
For Postgres:
 - Drop foreign key from 'revactor_page'
 - Change datatype of 'revactor_actor' to BigInt as in MySQL/SQLite
 - Make 'revactor_page' non-nullable as in MySQL/SQLite

For MySQL/SQLite:
 - Drop empty string default constraint from 'revactor_timestamp' as
 this is not allowed in the corresponding PG's TIMESTAMPTZ field

Bug: T230428
Bug: T164898
Change-Id: I8c5c4b338a3000b1e4c2ab82fdae4a9819925868
2020-11-10 12:27:40 +01:00
Ammar Abdulhamid
01cd9e25d7 Migrate revision_comment_temp to abstract schema
For Postgres:
 - Change 'revcomment_comment_id' to BigInt as it's in MySQL/SQLite

Bug: T230428
Bug: T164898
Change-Id: I4b5af210b63d932e2eb0120075a5fa5250924ace
2020-11-10 07:35:10 +01:00
Ammar Abdulhamid
c0cbed665a importTextFiles.php: Replace deprecated WikiRevision:setText()
Bug: T267558
Change-Id: I23d2af6bdeb84b782e70cedc0f57f08efd879eb7
2020-11-10 01:35:41 +01:00
jenkins-bot
b8f3822d52 Merge "Reduce some references to $wgUser" 2020-11-09 14:53:37 +00:00
Amir Sarabadani
b14f9ead33 Migrate ip_changes to abstract schema
In order to make Postgres work:
 - Dropped the autoincrement sequence, this is the PK without
   autoincrement
 - Change ipc_hex from BYTEA to TEXT
 - Set default for ipc_rev_id

MySQL/SQLite:
 -Drop default for ipc_rev_timestamp

Bug: T230428
Bug: T164898
Change-Id: I7f85d65f6ee3ac8b1d28e33095f37dce81e1727e
2020-11-05 22:38:50 +01:00
jenkins-bot
c823e03ec9 Merge "Migrate externallinks to abstract schema" 2020-11-05 19:03:56 +00:00
Ammar Abdulhamid
bafdce78b1 Migrate externallinks to abstract schema
Postgres changes:
 - Drop foreign key from `el_from`
 - Change 'el_index_60 type from BYTEA to TEXT
 - Set default for `el_from` to sync with MySQL
 - Also renamed these indexes to sync with MySQL
   - 'externallinks_from_to' -> 'el_from'
   - 'externallinks_index' -> 'el_index'
 - Add index 'el_to' on 'el_to' and 'el_from' columns. This completes
   the PG indexes to 5 to match up MySQL indexes

Bug: T230428
Bug: T164898
Change-Id: I1ab9bde19e456256db99d1244130e8ee11f9b6c8
2020-11-05 19:00:24 +01:00
jenkins-bot
a6ab1f9ac0 Merge "Remove unnecessary $wgHooks reference" 2020-11-04 10:56:58 +00:00
Tim Starling
3aa7afb265 Remove unnecessary $wgHooks reference
The hook is not called because the script calls setTemplateCallback(),
avoiding statelessFetchTemplate() which calls the hook.

The hook function is wrong anyway and wouldn't have worked if it was
called.

Removing because it makes Phan fail on an unrelated change.

Change-Id: Ia6a5b265dca5e0debc6f66dd5287105f44bbde88
2020-11-04 10:29:25 +11:00
Reedy
0ed7e674dc Make ImageBuilder::checkMissingImage public
It's used in a callback passed to another class

Bug: T267105
Change-Id: I4fd96278b19ed0a5c379cc4e5d3173fe9ff1fd03
2020-11-03 15:48:57 +00:00
Umherirrender
1b80321f39 Replace deprecated Title::getCdnUrls
Change-Id: Ie3cd9ebd6ef442af19a054a1bb81e5c3574fb2bb
2020-11-03 11:58:05 +01:00
Ammar Abdulhamid
7fbcee5748 Migrate protected_titles to abstract schema
For Postgres:
 - Drop foreign key from pt_title
 - Change pt_user to non-nullable to sync with MySQL
 - Change pt_expiry to non-nullable to sync with MySQL
 - Modify pt_reason_id to use BIGINT to sync with MySQL
 - Drop default from pt_create_perm field since MySQL and SQLite
don't have it and the field is not nullable.
 -

For MySQL/SQLite:
 - Modify pt_title to use varbinary
 - Drop DEFAULT constraint from pt_expiry (Postgres already does not have it)

Bug: T230428
Bug: T164898
Change-Id: Iff193754260046222ba9b7e704c46e27f21b1a6b
2020-11-02 15:05:23 +01:00