Commit graph

216 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
Umherirrender
fa40110671 schema: Make page_id references unsigned
This includes:
page_props.pp_page
page_restrictions.pr_page
ipblocks_restrictions.ir_value

These columns must hold all possible values from page.page_id,
which is an unsigned integer.

These patches doesn't apply to Postgres.

Bug: T297212
Change-Id: I789f19f4d52daeab08f3090771404d078f86d0b3
2022-01-27 20:20:00 +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
Amir Sarabadani
4a6e986141 Add linktarget table
Bug: T299416
Change-Id: Icae4513dd99635335857100d8a0c7102986933e5
2022-01-21 15:52:58 +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
Umherirrender
2b45d064ca schema: Fix typo about site.site_id in comment
The table calls sites

Change-Id: I361e1a3207259ef4d85f1e46b3c75f4d655ff0b6
2021-12-01 20:23:29 +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
Ammar Abdulhamid
1adaca51c3 Rename change_tag indexes to have ct_ prefix
Bug: T270033
Change-Id: I8a429726c99f6cadea0d671fd871f66b5611c856
2021-06-08 17:57:15 +01: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
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
Amir Sarabadani
80c309788b Make page_is_redirect and page_is_new unsigned
Mistake during the abstraction (Ibdaf332ea1d)

It doesn't need schema change since 1.36 is not released yet.

Bug: T230428
Change-Id: I071c39dfadf185b01e9109085907d6e3deb1f02f
2021-05-12 10:52:32 +02:00
Ammarpad
d9400049cf Rename page_timestamp revision index
Rename to `rev_page_timestamp`

Bug: T270033
Depends-On: I16fc273b14e7f4b00e8c31ec1ed7712149aafe37
Change-Id: I93fcfb3caf8c6bd7f9e46921065b751c23571ae1
2021-04-30 06:58:25 +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
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
Amir Sarabadani
d9933fd212 Drop now unused patch-page-page_lang.sql from Sqlite
Leftover from I76b4235f13aef0, was supposed to be removed but forgotten.

Bug: T272199
Change-Id: I7bf0fa8bddac8fc567b148b6b434487fafa7eb68
2021-03-27 10:12:47 +01:00
Petr Pchelko
cf763fe116 Drop most hard-deprecated methods in Article
Bug: T239975
Change-Id: I6ca9fbaa699d0465a59e86abbf2bca6bbdb69c01
2021-03-24 19:34:41 +00: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
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
jenkins-bot
5b7fe6ff7c Merge "Remove SqliteUpdater::sqliteInitialIndexes and its sql patch" 2021-03-09 16:08:20 +00:00
Ammarpad
6b08f4278d Remove SqliteUpdater::sqliteInitialIndexes and its sql patch
This was added in 1.14 and upgrading directly from there is no
longer supported (I95d80e3)

Bug: T272199
Change-Id: I3008d697907c7dd0e33afd69f9bd4765835e8654
2021-03-09 12:17:38 +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
Amir Sarabadani
4a6d4baaed Migrate recentchanges table to abstract schema
This table is massive but thankfully we fixed most of its complexities
in previous patches.

For MySQL/Sqlite:
 - Change type of rc_title and rc_source from "varchar binary" to
   "varbinary"
 - Drop default of rc_timestamp
 - Change rc_timestamp from varbinary(14) to binary(14) to standardize
   timestamp datatypes

One index doesn't follow the uniform prefix rule but since it's in a
maintenance script, will fix that in a follow up.

Bug: T230428
Bug: T42626
Change-Id: I13994e02ad3a2293148346ef7be96746578ad854
2021-02-26 13:56:56 +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
Ammarpad
00d22d1b68 Drop 1.24 upgrade patch files
11 files for Mysql and Sqlite (Some shared)

Bug: T272199
Change-Id: I76b4235f13aef0674ed6b35c2a97edf6a4573d94
2021-02-13 08:18:12 +01:00
Ammarpad
876736e5d2 Drop 1.22 upgrade patch files
5 files for Mysql and Sqlite

Bug: T272199
Change-Id: Id95e19a2c6c9129c077b59a5b360ef2ecb192953
2021-02-12 19:25:29 +00:00
Ammarpad
1fa9fb9952 Drop 1.21 upgrade patch files
22 files for  Mysql and Sqlite

Bug: T272199
Change-Id: I21e7ce2394387984d1ffa2fc6467b24e50869a3b
2021-02-12 19:24:55 +00:00
Ammarpad
8b7df4c6fe Drop 1.20 upgrade patch files.
6 files for MySql and Sqlite.

Bug: T272199
Change-Id: Ic74a7b1a54d88f9c930951f511dfa0795369c471
2021-02-12 19:30:07 +01:00
Ammarpad
5c7ee84d47 Drop 1.19 upgrade patch files
9 files. Some shared by Mysql/Sqlite

Bug: T272199
Change-Id: I140f291b4395366f309350fbb95aa7b4141024e2
2021-02-09 22:28:45 +00:00
Ammarpad
09bf630920 Drop 1.17 upgrade patch files
14 files.

Bug: T272199
Change-Id: I0ff387e057c1fb35447595a596aa3fec455a795c
2021-02-08 16:55:15 +00:00
Ammarpad
e923c5f4c0 Drop 1.16 upgrade patch files
8 files for Mysql and Sqlite

Bug: T272199
Change-Id: I75acc632a248257520c68b911870f62d069b0bdd
2021-02-06 16:05:36 +01:00
Ammar Abdulhamid
dbd4dd19f8 Rename site_identifiers indexes to have si_ prefix
Bug: T270033
Change-Id: I6751f0fd992054b61222ece55c83d05d24af9000
2021-01-30 12:19:55 +01:00
Amir Sarabadani
fe6ff91134 Migrate image table to abstract schema
For MySQL/Sqlite:
 - Change datatype of img_name from "varchar() binary" to varbinary.
 - Drop default of img_timestamp

For Postgres:
 - Adding two missing indexes.
 - Renaming two indexes
 - Setting default value for five fields
 - Fix data type of four fields
 - Drop default of img_metadata
 - Make three fields not nullable

Bug: T230428
Bug: T164898
Change-Id: I237af3558b0e1c1fecd874c3c90ba6780e50aaa4
2021-01-28 20:13:03 +01:00
Amir Sarabadani
7f6c51617b Standardize archive indexes
For Sqlite and MySQL, renaming name_title_timestamp to
ar_name_title_timestamp so it follows the database convention.

For Postgres:
 - Rename archive_name_title_timestamp to ar_name_title_timestamp
 - Drop archive_actor (that has only ar_actor)
 - Add ar_actor_timestamp (that has ar_actor, ar_timestamp)

This fixes drifts of PG and MySQL and makes work for abstracting the
table easier.

Bug: T230428
Bug: T164898
Change-Id: I123a4c47602bdd415f0fe5823f96159dcd0d84b8
2021-01-28 11:32:49 +01:00
Amir Sarabadani
6e53acb7cc Migrate ipblocks to abstract schema
For MySQL/Sqlite:
 - Drop default values of ipb_timestamp and ipb_expiry as part of
   standardizing timestamp columns

For Postgres:
 - Drop foreign key on two columns as approved by the RFC
 - Set default of ipb_user
 - Make three columns not nullable to sync with MySQL
 - Change data type of two columns to BIGINT to be the same as MySQL

Bug: T230428
Bug: T164898
Bug: T42626
Change-Id: I2c5303d76c6ce059d7fef324a4521c6336c5b1f3
2021-01-23 18:21:24 +00:00
Ammar Abdulhamid
20d1849b53 Migrate objectcache to abstract schema
For Postgres:
 - Drop Unique constraint on `keyname` and make primary key
 - Change type of `value` from BYTEA to TEXT and drop its default
 - Make `value` nullable to sync with MySQL/SQLite

MySQL:
 - Change exptime from DATETIME to TIMESTAMP

MySQL/SQLite:
 - Make 'exptime' not nullable

Bug: T230428
Bug: T164898
Change-Id: Iab9de8a1bb2cb01b6e3e69e66f1bbe089d53d0a7
2021-01-20 13:50:28 +01:00
Amir Sarabadani
dba59bc223 Migrate oldimage to abstract schema
For MySQL/Sqlite:
 - Changing oi_name and oi_archive_name to varbinary instead of "varchar
   binary"
 - Dropping default from oi_timestamp

For Postgres:
 - Adding the correct default to seven fields
 - Removing incorrect default from oi_metadata
 - Add missing index oi_actor_timestamp
 - Change four fields to have correct data type
 - Make oi_major_mime and oi_minor_mime not nullable
 - Drop foreign key on oi_name

Bug: T230428
Bug: T164898
Change-Id: I4dff0e48081a5797a29513f9c8b87f9ffcaadb5d
2021-01-16 21:18:25 +01:00
Amir Sarabadani
c33876f834 Migrate text table to abstract schema
For MySQL/Sqlite, drop the table options, they are for MySQL < 5.0 which
was released in 2003 and not any use today.

For Postgres, rename pagecontent table to text, approved as part of the
RFC. Swap order of creating auto-generated tables and manual tables.

Bug: T230428
Bug: T164898
Change-Id: Id7510b80beed7a7297353094a57d5e2d4f12fc64
2021-01-09 16:07:54 +01:00
Amir Sarabadani
f9ccfa7cef Bring back timestamp time of cl_timestamp instead of binary(14)
Fixing this is going to be complicated. We have to first turn this into
varbinary(20), write a maintenance script to fix the values, then make sure
mediawiki work properly with two value types at the same time and then
turning it to binary(14).

For now, let's unblock 1.36 release, we will follow up on fixing this
for good later.

Bug: T270032
Change-Id: Iabbe8f085812acd90536a06fee2ecd4db9b047d5
2021-01-01 13:23:59 +00:00
Amir Sarabadani
37fc2d1ba1 Migrate filearchive to abstract schema
For MySQL:
 - Drop default from fa_deleted_timestamp and fa_timestamp
 - Change fa_name and fa_storage_group from varchar() binary to
   varbinary()

For Postgres:
 - Set default for three fields
 - Drop foreign key on fa_deleted_user
 - Change field type for five fields
 - Rename indexes to make it make in sync with MySQL/Postgres
 - Rebuild an index to make it in sync MySQL/Postgres

Bug: T230428
Bug: T164898
Bug: T42626
Change-Id: Ia2be151c46c73f15592db03540834a6456460cac
2020-12-23 04:04:27 +01:00
Amir Sarabadani
443c94de3f Rename four logging indexes to have log_ prefix
To follow database coding convention and avoid clashes in RDBMS engines
where indexes are global

Bug: T270033
Change-Id: I17028bba489d04b01d22c39dc8935a4f0f771c7e
2020-12-21 07:39:50 +00:00
Ammar Abdulhamid
9907b56c9b Rename all sites indexes
Use uniform prefix with the column names

Bug: T270033
Change-Id: I771ffc67a1363d8877c57dce1d8b2acdca8fe5bb
2020-12-16 03:17:06 +01:00
Ammar Abdulhamid
58dee4465c Rename user_properties index
Use uniform prefix with the column names

Bug: T270033
Change-Id: I9ee1f8ac9a8d0e575e16344910495f341c2714db
2020-12-15 04:37:08 +01:00
Amir Sarabadani
5f374fa3f8 Migrate uploadstash to abstract schema
For MySQL:
 - Migrating us_timestamp from varbinary(14) to binary(14) to
   standardize timestamp fields

For postgres:
 - Fixing datatype of 8 fields of the table
 - Set "NOT NULL" for 7 fields
 - Rename indexes to drop _idx suffix

Bug: T230428
Bug: T164898
Bug: T42626
Change-Id: I5391416ae463856cf5e9b05f542dec9b389b2f7c
2020-12-13 19:12:36 +01:00
Ammar Abdulhamid
b9094b0248 Migrate logging to abstract schema
Some changes needed for the migration:

Postgres:
 - Add default to five fields that have it in MySQL
 - Make log_params not nullable
 - Change log_comment_id and log_actor type to big integer
 - Change log_namespace to integer
 - Drop logging_actor_time index

MySQL/SQLite
 - Change log_title to varbinary/BLOB

Bug: T230428
Bug: T164898
Change-Id: Iad59d2a78f61d93637917ca320d3e173863ce5e1
2020-12-11 21:40:28 +00:00