Commit graph

315 commits

Author SHA1 Message Date
Alexander Vorwerk
d66fe8b7c7 Bump minimum required version for upgrade to 1.31
The policy allows this and since 1.39 is going to be the next LTS
release, I think it is fine to do this now.

Change-Id: If426e0ee349252ccc0ba9c4222c7d6865ab57fa2
2022-03-15 22:12:59 +01:00
Amir Sarabadani
9137db1d8a Add tl_target_id to templatelinks
Part of normalizing it, note that the field must be nullable now and
that will change later.

Bug: T299418
Change-Id: Id543dfa20a153312f66d2f45a64ac23e7272dabe
2022-01-28 17:41:01 +01:00
Amir Sarabadani
203d422dc4 Drop rev_page_id index on revision
This is already applied in production and known to be safe.

Bug: T163532
Change-Id: Ief29372f13b2d7cdb19395dcda6eb15e9a53efca
2022-01-27 09:43:27 +01:00
jenkins-bot
ed940242bb Merge "Add linktarget table" 2022-01-27 00:23:03 +00:00
Amir Sarabadani
4a6e986141 Add linktarget table
Bug: T299416
Change-Id: Icae4513dd99635335857100d8a0c7102986933e5
2022-01-21 15:52:58 +01:00
Alexander Vorwerk
78ee5ed0d1 Replace remaining usages of deprecated IDatabase methods
Bug: T286694
Change-Id: I15c782ee8d4137604e27fd05a6b87ce2f9975a07
2022-01-21 00:06:29 +01:00
Amir Sarabadani
be574baa56 installer: Fix Postgres mistakes in using changeField method
This is breaking update.php for PG now

The last one, if not empty must have DEFAULT in it.

Bug: T286779
Bug: T297031
Change-Id: I34070440a766c21baede849c70f06e6e1dbfd5f7
2021-12-07 21:07:53 +01:00
Amir Sarabadani
ede308ed55 Drop pr_user from page_restrictions
It's not used for 13 years, safe to say it won't be used anytime soon

Bug: T199377
Change-Id: Iecf4fb6046699a1758ad2d1dc55a3ee8eb4b0389
2021-12-06 14:15:39 +01:00
Amir Sarabadani
afe4bbdbe3 media: Drop XML metadata support from DjvuHandler
All of production has been migrated to json and this patch also adds an
update entry for third parties.

Bug: T275268
Change-Id: I916127896bdce95472823ae7be12fc5e6e16691a
2021-11-21 15:47:56 +01:00
Amir Sarabadani
753a4ecdd3 Bump minimum required version for upgrade to 1.29
Since the branch cut has happened, we can bump and get rid of legacy
cruft. According to the policy we can go up to 1.31 but let's keep it
that way to avoid major distruptions.

Change-Id: I9d697445a3bb5047726c8b2a7f808edb8403cdda
2021-09-28 17:57:57 +02:00
Umherirrender
1d178e177b Remove unneeded continue/return statements
Change-Id: I26f9845b09ecc15de8b6e0213ab369b386194c9d
2021-08-17 22:53:53 +02:00
jenkins-bot
170f5c21a6 Merge "Rename change_tag indexes to have ct_ prefix" 2021-06-08 17:50:09 +00:00
Ammar Abdulhamid
1adaca51c3 Rename change_tag indexes to have ct_ prefix
Bug: T270033
Change-Id: I8a429726c99f6cadea0d671fd871f66b5611c856
2021-06-08 17:57:15 +01:00
DannyS712
a84ad7bd40 Add some missing __METHOD__ parameters to database calls
Plus fix a typo

Change-Id: I8ca326990559ea80254ce0cef2ed204590716679
2021-06-07 19:28:51 +00:00
Ammarpad
a8c01d7726 Rename name_title index to have page_ prefix
Bug: T270033
Change-Id: Id70d0e0a37dd0d000079820d51cef2791f5ec42e
2021-06-05 20:21:07 +02:00
Amir Sarabadani
7fdca7ce51 Add index on oldimage.oi_timestamp
Mirroring what happens on image table.

Bug: T279982
Change-Id: Ib67c32b10d3b88e09514d8fbb5dcb4f977108ba2
2021-05-29 20:44:32 +02:00
Amir Sarabadani
4444264dfe Fix name of searchindex table in PostgresUpdater
Follow up to I9f33132676344f8cd8

Change-Id: I365e0fa2a8cc7c00d67572e108f892b95094d199
2021-05-28 12:40:44 +02:00
Amir Sarabadani
acd5076099 Migrate searchindex to abstract schema
For MySQL/Sqlite:
 - Nothing

For Postgres:
 - Introduce the table. It's not used but it'll be used in the future (T220450)

Bug: T164898
Bug: T230428
Bug: T220450
Change-Id: I9f33132676344f8cd813f7a438b3a6a078fd281c
2021-05-27 15:01:24 +02:00
Ammarpad
5954b380fc Migrate revision table to abstract schema
Postgres:
 - Drop foreign key from rev_page
 - Make rev_page not nullable
 - Change rev_comment_id from int to bigint
 - Change rev_actor from int to bigint
 - Sync rev_page_id index with MySQL

MySQL/SQlite:
 - Drop default from rev_timestamp

Additional changes in the generator script to handle more
formatting issues due to use of additional custom table options

Bug: T230428
Bug: T164898
Change-Id: Ia07dd52e43123473a1728523a3f863280537db8e
2021-05-20 14:52:15 -07:00
Aaron Schulz
12923c1cd5 objectcache: add last-modified token field to objectcache table
Also added token and flags fields. The token field can
be used as a tie-breaker for modtime and also for faster
cas() operations. The flags field makes serialization and
compression format changes easier in the future.

Bug: T274174
Change-Id: I45731a877b21835652993c2d285165a76eeae3e9
2021-05-18 20:06:37 -07:00
Ammarpad
f100eb3b2a PostgresUpdater: Drop updateUserTableSequence function
Bug: T164898
Change-Id: I16c5548eb4f67509182ca4da5daf47ac6c0c4a9d
2021-05-17 22:38:19 +01:00
Ammarpad
82d2675ae6 PostgresUpdater: Simplify working with constraints
Change-Id: I05d42fcd25c952617f7ec3b92e1bfb32ff8513c5
2021-04-26 15:19:44 +01:00
Ammarpad
88bfadf5ed Migrate user table to abstract schema
Postgres:
 - Rename the table from `mwuser` to `user`
 - Transition user_id from int to serial
 - Make user_token not nullable and add default
 - Make user_real_name not nullable and add default
 - Make user_email not nullable
 - Make user_newpassword not nullable
 - Make user_password not nullable
 - Drop UNIQUE contraint on user_name and add default

MySQL/SQLite:
 * No changes

Bug: T164898
Bug: T230428
Change-Id: I746714f7b3ae16f9625f97bcca84280fcd8b61a0
2021-04-24 21:44:26 +01:00
Amir Sarabadani
4acdf1669d Final fixes of Postgres updater for REL1_36
Tested upgrade from 1.35 locally, and it broke due to two issues:
 - text table didn't exist, making renaming the table the first update.
 - the update was using user instead of mwuser. That was intentional on
   the grounds that it'll be fixed soon, but it seems I746714f7b3a is
   not going to make to the release.

Bug: T164898
Change-Id: I0c152f339954a001c5a5a0b94b8ad48e5b077290
2021-04-10 19:37:55 +00:00
jenkins-bot
3f96a72ac9 Merge "Prepare for migrating user to abstract schema" 2021-03-28 10:31:03 +00:00
Ammarpad
c697406d3f Prepare for migrating user to abstract schema
Split off to make the migration patch smaller

Postgres:
 - Make user_touched not nullable

MySQL/SQlite
 - Change user_name from varchar to varbinary
 - Change user_name from varchar to varbinary
 - Drop empty string default from user_touched (Timestamp field)

Bug: T230428
Bug: T164898
Change-Id: I8fe0b1fb2af3149a2e2fdae7bb056ac6f863b09c
2021-03-28 09:55:07 +01:00
Ammarpad
eece54b831 Remove unused schema change.
There's no reason to keep schema change that's no longer useful.
History is already tracked by git.

Change-Id: Ia8aa0d21ae5f2d799d9a641ebe7b924f56e07ab1
2021-03-27 09:32:29 +01:00
jenkins-bot
1857b8244b Merge "Drop rest of unsupported upgrade paths and patches in Postgres" 2021-03-26 19:04:53 +00:00
jenkins-bot
35657bca57 Merge "Move updates around in Postgres to make it sequential" 2021-03-26 19:04:45 +00:00
jenkins-bot
d904a7159b Merge "Drop tsearch fixes in postgres" 2021-03-26 19:04:18 +00:00
jenkins-bot
6ce397faf5 Merge "Fix several issues in upgrading from 1.35 to master in Postgres" 2021-03-23 22:48:45 +00:00
Amir Sarabadani
4168c88d6a Fix several issues in upgrading from 1.35 to master in Postgres
- Currently the updater just spams with
Changing column type of 'archive.ar_actor' from 'bigint' to 'BIGINT'

The strtolower reduces this spam.

 - Remove dropping the old index and constraint that is already handled
   in line above.
 - Remove adding an index on image table that was added twice by mistake
   and this one actually is on wrong fields which breaks.

Change-Id: Iae3f90f71519b4bdbdf8f26b623c817e5b45164b
2021-03-22 11:56:42 +01:00
Amir Sarabadani
6ba7c4fa09 Drop rest of unsupported upgrade paths and patches in Postgres
These are from versions we don't support direct upgrade anymore and they
are already removed from update.php wiring.

Bug: T272199
Change-Id: I863d91d7d620943571cb8bb22f663c2efbbd0821
2021-03-22 07:43:34 +01:00
Amir Sarabadani
b4033cb3c4 Move updates around in Postgres to make it sequential
It was only one update left after cleaning up unsupported upgrades.

Change-Id: Id9a86e1f296b71513197bb3c8302c8ca5215d0cc
2021-03-22 07:35:45 +01:00
Amir Sarabadani
447db80038 Drop tsearch fixes in postgres
These changes to tsearch functions were introduced in 2010 in a version
that we definitely don't support direct upgrades from.

Bug: T272199
Change-Id: I47c4054552daad55c0e13eec36865706ee6d1903
2021-03-22 07:29:06 +01:00
Amir Sarabadani
e2c005f91f Drop unsupported 1.23 upgrade code and patches from Postgres
We don't support upgrading from 1.23 anymore.

Bug: T272199
Change-Id: Iac9652095927c86c47f45a2aa131c28efef5c73a
2021-03-22 07:26:53 +01:00
Ammarpad
53f24f2ac8 Postgres: Fix revision table indexes drifts with MySQL
Added new index: 'rev_page_timestamp' (the corresponding index
in MySQL is currently 'page_timestamp' but it will soon be
renamed to have the rev_ suffix as part of T270033).

Rename rev_timestamp_idx and revision_unique to match names
that are in use for MySQL

Bug: T230428
Bug: T164898
Change-Id: I3a79a892673b073cea57ee4e397b2963c7cef2f1
2021-03-21 18:29:12 +01:00
Ammar Abdulhamid
6a3aa5b5a2 Migrate page to abstract schema
Postgres:
 - Change page_namespace from smallint to int
 - Change page_random from numeric with arbitrary precision to float
 - Make page_touched not nullable

MySQL/SQLite:
 - Change datatype of page_title from varchar (with binary collation)
   to varbinary(255)
 - Drop default empty string from timestamp field of page_touched

Bug: T230428
Bug: T164898
Change-Id: Ibdaf332ea1da309d31d35a6ebbc1b8fefced335e
2021-03-21 12:07:12 +01:00
Amir Sarabadani
11f091db7d Drop add_interwiki updater in Postgres
This function was removed in abstracting interwiki table (Id652cb544)
and it's not needed anymore.

Change-Id: Ifc956ae91f8362e9872cd449fcab5cfb4870ec7f
2021-03-20 18:25:02 +00:00
Amir Sarabadani
6a8bf52415 postgres: Fix drifts of indexes in user table compared to mysql
This is to make the migrating this table to abstract schema easier.
And reduce schema drifts between postgres and mysql.

Bug: T230428
Bug: T164898
Change-Id: I97a8791283e2499a559f1debb9b3c66909069283
2021-03-19 19:08:11 +00:00
Amir Sarabadani
2cc79854e8 Migrate archive table to abstract schema
One of the last ones left.

For MySQL/Sqlite:
 - Dropping default of ar_timestamp, empty string is not a valid
   timestamp.
 - Changing ar_title from "varchar() binary" to varbinary

for Postgres:
 - Set default for ar_namespace and ar_title
 - Change datatype of ar_comment_id, ar_actor, ar_namespace
The indexes were fixed separately.

Bug: T230428
Bug: T164898
Bug: T42626
Depends-On: I83cf1cd51ac9cf933c9175cefd6e38a6914f3494
Change-Id: Ic1d13a82b27f7fa39a0f0ea9c5b7b193b007e4ab
2021-03-13 21:51:16 +01:00
Ammarpad
cafd733c4f Postgres: Drop 1.24 upgrade logic
Bug: T272199
Change-Id: Ia68722e21a0e6310983932af32611f8da7190e6a
2021-03-09 07:20:05 +01:00
Ammarpad
2ca437dca9 Drop 1.27 upgrade patch files
6 files for Mysql/Sqlite/PG

Change-Id: Idef4906c5a7fdac2667c35bac7e8cc54629647f8
2021-03-09 07:15:37 +01:00
Amir Sarabadani
1053405664 Rename new_name_timestamp on recentchanges to rc_new_name_timestamp
To make it have a uniform prefix for index and column names

Bug: T270033
Change-Id: I8eb600416913092bd5aeb70389bba6e8a54d1d57
2021-03-01 19:00:52 +00:00
Ammarpad
a435378257 PostgresUpdater: Move bot_passwords table addition down
This should have no effect, but it helps in making this file
consistent with  Mysql/Sqlite updaters.

Table was introduced in 1.27 (Iaa4015e) and was added in
'new tables' section, because then Postgres separated them
per patch type instead of per release.

Separating them per release (as MySql/Sqlit do) is more logical
and it's even more important now that we are not keeping them
indefinitely.

Bug: T272199
Change-Id: I1fa6d81c9903fb6188f00b791794b3199a0a5aa3
2021-02-17 18:51:00 +01:00
Ammarpad
e4852caaa3 Drop 1.25 updgrade patch files.
5 files for MySql/Sqlite/Postgres.

MysqlUpdater.php seems to have incorrect comment for 1.26 release
The hitcounter table was dropped in 1.25 (I0e5006a), so all the
files dropped here are part of schema change for 1.25.

Bug: T272199
Change-Id: I6a509a54d31f68e423b3d76d26259b1f88aa22bd
2021-02-17 18:09:08 +01:00
Amir Sarabadani
fa7b284d70 Remove all old index checks in PG
I checked all of them with https://github.com/wikimedia/mediawiki/blob/REL1_26/includes/installer/PostgresUpdater.php
using a script and all of them except one are old and have
not been added after 1.26. The only left is actually added but changed
in the mean time and is needed.

Also cleaning up checkIwlPrefix that was introduced in 1.17.

Bug: T272199
Change-Id: Ifc58c8d860ebc0e6d154203cafc6a64654bced92
2021-02-13 20:24:14 +01:00
Amir Sarabadani
a20d1dfe17 Remove all old index additions in PG
I checked all of them with https://github.com/wikimedia/mediawiki/blob/REL1_26/includes/installer/PostgresUpdater.php
using a script and all of them are old and have not been added after 1.26

Bug: T272199
Change-Id: I47927d886c45ad9db25f1fdc035f1968f0c80993
2021-02-13 06:10:54 +01:00
Amir Sarabadani
7da3ba32b9 Remove all old data type changes and null changes in PG
I checked all of them with https://github.com/wikimedia/mediawiki/blob/REL1_26/includes/installer/PostgresUpdater.php
using a script and all of them are old and have not been added after 1.26

Bug: T272199
Change-Id: I3a48b16f91e7c08b3f4e7e6e3cdfd2287d50ee7d
2021-02-11 00:27:58 +01:00
Amir Sarabadani
f4667aecc1 Remove all old new field schema changes in PG
I checked all of them with https://github.com/wikimedia/mediawiki/blob/REL1_26/includes/installer/PostgresUpdater.php
using a script and all of them are old has not been added after 1.26

Bug: T272199
Change-Id: I643dd097240ebabb6bc4c3762ca3799e76d78e2b
2021-02-10 16:34:35 +01:00