Commit graph

756 commits

Author SHA1 Message Date
Umherirrender
9854946391 schema: Remove allowInfinite from page_links_updated
This timestamp is to track the last refreshlinks run and is always now
or in the past, there is no need to hold the infinite value.

This only affects mysql

Bug: T298317
Change-Id: I16978e076a795258639591a2fbfe353f67d0ec64
2024-07-29 22:48:07 +02:00
Amir Sarabadani
bb6c6e4174 schema: Drop old pagelinks columns
It has been dropped in production already.

Bug: T299947
Change-Id: I8ec1e7d9224c81d6494c39c78df9e4bdac38d377
2024-06-18 21:13:38 +02:00
jenkins-bot
f99f308bf4 Merge "Drop 1.35 db updates" 2024-05-05 06:50:24 +00:00
Alexander Vorwerk
28bdd790ee Make rc_id a bigint
Wikidata is at 51.3% of its maximum value (see [1]), so we still have
comfortable time to make this change, but it will inevitably be
necessary and there is no point in postponing this change into the
future. The autoincrement value will not get smaller. ¯\_(ツ)_/¯

Also since rc only stores stuff for 30 days, the table is not that
big.

[1] - https://grafana.wikimedia.org/d/79S1Hq9Mz/wikidata-reliability-metrics?viewPanel=29&orgId=1

Bug: T63111
Change-Id: Icf3dc9815814ef73aa6a39f1c221a349e6b76872
2024-05-04 21:14:51 +02:00
Alexander Vorwerk
b2d44a162c Cleanup revision table schema
* Drop default value from rev_actor and rev_comment_id
* Make rev_id a bigint

Bug: T215466
Depends-On: I88318d7bcc063bc86a56eeb5f00048ea6e81964b
Change-Id: Id0a3d920e8b2dc8643fa3c0341b34ab3ed5761dc
2024-05-04 20:22:36 +02:00
Alexander Vorwerk
bda3118e56 Drop 1.35 db updates
Per official policy, updates from versions older than two LTS releases
are not supported.

Change-Id: I8fb08e226c1a37580f95ee622a0703eee312d9ba
2024-05-03 12:53:12 +00:00
Kunal Mehta
903544aabc Update Apache config syntax in .htaccess files
"Deny from all" is deprecated; the replacement syntax has been
available since Apache 2.4 (originally released in 2012).

See <https://httpd.apache.org/docs/2.4/howto/access.html>.

Bug: T360850
Change-Id: I825053ccefe34f6ca4e04af5ad2601f79e4d51a7
2024-03-23 23:36:31 -04:00
jenkins-bot
bca2f1281e Merge "Schema: Drop iwl_prefix_from_title from iwlinks" 2024-02-09 16:39:59 +00:00
Brooke Vibber
dcd9c3ae26 Update name & email for bvibber
Updating name & email addresses for Brooke Vibber.

Re-ran updateCredits.php as well so there are some new entries in
there as well.

There are a couple of files in resources/libs that will have to
be changed upstream to keep tests happy, I will do patches
later. :D

Change-Id: I2f2e75d3fa42e8cf6de19a8fbb615bac28efcd54
2024-02-08 17:02:16 -08:00
Amir Sarabadani
f0bfc3d433 Schema: Drop iwl_prefix_from_title from iwlinks
After exhuastive research, we concluded that iwl_prefix_from_title is
not used and in case it's actually used, other indexes provide enough
cardinality.

This table is about to grow quite large in Commons, let's avoid making
it bigger than it needs to be.

Bug: T343131
Change-Id: I89e40dff384291968d2465e4109a3d212ae2f8c7
2024-02-08 17:01:26 +01:00
Amir Sarabadani
616744db1d Schema: Drop unused and useless indexes of sites table
This table has eight indexes plus PK. It has around 1000 rows only. Even
if it needs these indexes (which it doesn't), they are still useless.

Looking at the code, the only potential useful index is the one on
site_global_key, they are showing up in the report of unused indexes in
the db and I checked with Fandom (which might benefit from an index on
this table) and they said they don't use sites table.

Bug: T342856
Change-Id: I06b3db0f33bd35bfa68f4b418d8c2f4b9b988409
2024-02-01 15:32:05 +01:00
Amir Sarabadani
f056a26242 Schema: Drop cl_collation_ext index
Unused since Ie4dd91ee29308c980e

Bug: T342854
Change-Id: I3acf563c64ff176ade3e0c6745839a168e92473b
2024-01-26 16:16:41 +01:00
Tim Starling
fd9c7c2d3e Add the new block and block_target tables
Bug: T346293
Change-Id: I3822ad03227405a608dea1d788bcdb8321b95bb3
2024-01-08 14:29:59 +11:00
Thalia
caf9912323 Use year in temporary user names and restart index each year
Why:

* Part of a temporary user name is generated from an index that
  increments, which is stored in the database.
* As specified in T345855, the index will be restarted each year.
* Also specified in T345855, the year will be included in
  generated temporary user names.

What:
* Since the year must be included in the name in order to avoid
  naming conflicts if the index is restarted each year, both are
  implemented together and controlled by a single config.
* Add a new config option that, when true, restarts the name
  generation index at the start of each year and add the year into
  the user name: $wgAutoCreateTempUser['serialProvider']['useYear']
* Add a uas_year column to the user_autocreate_serial table, which
  is unique in combination with uas_shard, so the index can be
  stored for each shard/year combination.
* The year is added into the username just after the prefix, as
  specified in T345855. This is based on research that having the
  year near the start of the name aids understanding that the
  names are not IP addresses. The position of the year within the
  name is therefore not configurable (though whether to include
  it is). See T345855 for the research.

Bug: T349494
Bug: T349501
Depends-On: I6b3c640a4e74f52fd4a4f46de5a2cbe80fe3b665
Change-Id: If51acb3f4efa361ce36d919c862a52501a5a7d24
2024-01-05 17:14:19 +00:00
Brian Wolff
86608dfd4f Store image sizes as 64-bit bigint instead of 32-bit integers
This is meant in preparation for MediaWiki supporting files
larger than 4gb.

Bug: T191805
Change-Id: Ie67dd01aa0a8b28d9afc1805243e711fcadbc0f8
2023-10-04 08:01:25 -07:00
Amir Sarabadani
e5eda1c358 Schema: Drop old externallinks columns and indexes
Already dropped from production

Also dropping FixExtLinksProtocolRelative as it's not useful anymore and
it has been run in previous releases so it's not worth fixing.

Bug: T312666
Change-Id: I1dd6e704b34e685ada6e316da11243d10827d769
2023-09-05 15:32:23 +02:00
Amir Sarabadani
dae881296d Schema: Add pl_target_id column to pagelinks
Similar to templatelinks

Bug: T342689
Change-Id: I2ed692d7d0cdf756d29618363bec7fc761ff3df1
2023-07-25 21:03:45 +02:00
Amir Sarabadani
080883da09 Schema: Set default or nullable to three columns of externallinks
We need to drop these columns and we need to make them take default
values so we can issue write queries without these columns.

Also noting that MySQL prior to 8.0 can't set default values to blob
columns making this way more complicated than it should be but MariaDB
can set them (https://mariadb.com/kb/en/blob/). We also made these
columns nullable to make this work in MySQL.

Bug: T341828
Change-Id: I0d60742b6ce7adf642393ee00b66aa539b76dfc1
2023-07-18 11:59:09 +02:00
Thalia
f283c0e990 schema: Add user_is_temp column to the user table
This allows temporary users to be identified from applications
external to MediaWiki, by the user table alone (without referring
to the $AutoCreateTempUser['matchPattern'] config).

Bug: T333223
Change-Id: I83c5ff42654164590fb0361c84e65a5315ddbda8
2023-05-10 19:18:39 +01:00
Alexander Vorwerk
599b5a0918 Drop 1.34 db updates
Per official policy, updates from versions older than two TLS releases
are not supported.

Change-Id: I3dc98fe61c8a508aa3ade694f8c0a6a00115031b
2023-02-09 23:28:10 +00:00
Amir Sarabadani
080c70879a schema: Add new fields for externallinks so we can reduce duplication
Bug: T318604
Change-Id: I217817bc518eaa86c9952187c6f1a861f480ccaf
2022-10-18 16:18:54 +00:00
Amir Sarabadani
c910301518 Drop useless maint scripts and sql files after 1.31-1.33 clean up
These files are not needed anymore. Either because they are orphan now
and no updater will run these sql files.

Or they are maint scripts to migrate the data and that has been removed
in I5ff9630a65 and I84bd1d3dbe7

Change-Id: I00c49d8d649e3fa7641f3c57bf3ea4440ae542df
2022-09-28 16:22:14 +02:00
Amir Sarabadani
4bde067722 Drop 1.32 and 1.33 db updates
Per official policy, updates from versions older than two TLS releases
are not supported.

Finding the implicit marker is a bit tricky. The user might try to
upgrade from a really old version that doesn't have tag_summary table
and mistakenly think it's new and allow upgrade. So turning the check
logic into a boolean AND where it must be new enough to have
change_tag_def table AND new enough not to have tag_summary table.

Change-Id: I5ff9630a6539a587a47930847e108ac53757106f
2022-09-26 18:34:31 +02:00
Amir Sarabadani
310e819750 Drop 1.31 db updates
Per official policy, updates from versions older than two TLS releases
are not supported.

We can drop more versions, given that 1.39 is LTS but to ease the
review, let's drop one release per patch

Change-Id: I84bd1d3dbe777909e30710fff5bcb655af9a4261
2022-09-26 17:49:02 +02:00
Amir Sarabadani
6c4194e23e schema: Drop tl_title and tl_namespace fields from templatelinks
The day has gone. Still keeping the code as the schema changes are not
done in production but the data migration has been finished.

Bug: T299417
Change-Id: I906e069a63d1dae14924c72318b22b16244371d6
2022-09-06 19:53:15 +02:00
Amir Sarabadani
692dde00df Add support for write new for templatelinks migration
- schema change to allow tl_namespace and tl_title being empty
   This is done by removing them from primary key. They don't need to be
   nullable as they have default value.
 - Make sure with WRITE_NEW, updater avoids writing to the old columns

Bug: T306674
Change-Id: I2b8a29043e952060e7a79b6a7a3d647d48cd16fb
2022-07-12 14:46:54 +02:00
Amir Sarabadani
ce0b6f40fa schema: Drop legacy page_restrictions in page table
Bug: T35334
Change-Id: I17e73d5ef165481a5dd4c210da933b99c65ff79c
2022-05-26 13:59:57 +02:00
diesel kapasule
6e97f2491b Schema: Updating user_editcount field to unsigned
I have updated user_editcount field to unsigned in
tables.json

This patch doesn't apply to Postgres.

Bug: T305340
Change-Id: I07a360944a10be9cc8ed8731c6286412294413a3
2022-05-09 21:34:11 +00:00
Umherirrender
52aebe227b schema: Make ipblocks.ipb_id unsigned
It makes it more consistent with AUTO_INCREMENT PRIMARY KEY columns on
other tables.

This includes ipblocks.ipb_parent_block_id and
ipblocks_restrictions.ir_ipb_id as well

This patch doesn't apply to Postgres.

Bug: T297208
Change-Id: I950aba63b2b226abbaf4010fbb51415bbff117f4
2022-04-14 17:45:41 +02:00
Tim Starling
e8dbf5f80c TempUser infrastructure and services
Add services and utilities for automatic creation of temporary user
accounts on page save, in order to avoid exposing the user's IP
address.

* Add $wgAutoCreateTempUser, for configuring the system
* Add TempUserConfig service, which interprets the config.
* Add TempUserCreator service, which creates users during page save as
  requested by EditPage. With proxy methods to TempUserConfig for
  convenience.
* Add table user_autocreate_serial. Table creation is necessary before
  the feature is enabled but is not necessary before deployment of this
  commit.

Bug: T300263
Change-Id: Ib14a352490fc42039106523118e8d021844e3dfb
2022-04-14 09:23:55 +10:00
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
9760f5ef89 installer: Set "unknown" for default value of *_major_mime in MySQL
Follow up to Ic45dc1bce796a0 which added a schema change that mistakenly
removes the default value and given that it was done long time ago and
the main patch was removed since then, we can simply add a new patch for
broken cases.

Sqlite and Postgres don't need this change as they didn't get the patch
in the first place.

Also fixing the nullability of these fields.

Bug: T277354
Change-Id: Iced6fc6a7127a33cc171174270eba5cc552c871e
2022-01-03 12:12:44 +01:00
Umherirrender
45c84bf927 schema: Make filearchive.fa_id unsigned
It makes it more consistent with AUTO_INCREMENT PRIMARY KEY columns on
other tables.

This patch doesn't apply to Sqlite or Postgres.

Bug: T297207
Change-Id: I5e58f23ea2441ef93ce7254210158d8094bd9010
2021-12-07 15:25:13 +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
James D. Forrester
20fd877da4 Drop experimental FileJournal system without deprecation
The feature was introduced in 2012 with d19f54602f (just before
the gerrit migration).

Change-Id: Ia3f59ad0ddeb1f610947b14e22b0694ff4c6ed84
2021-11-01 14:08:09 +11: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
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
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
Amir Sarabadani
13c298fcc9 Drop unused patch-watchlist.sql
This patch was introduced in r1030 (2002) and was never
wired to update.php and any mention of it was removed from documentation
in r23242 (2007). Since then, you can't find any mention of this file.
It clearly won't run on any modern mediawiki database.

Change-Id: I49a7a0bd53d5fb1b97f9c7016bb72d29e50211f7
2021-04-02 00:09:59 +02:00
Amir Sarabadani
1bcee79097 Drop now unused patch-interwiki.sql
Follow up to I0de40b8dc6

Bug: T272199
Bug: T273080
Change-Id: I639f31e2ece1c936a9013f504e545796aa636724
2021-03-30 20:04:09 +02: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
jenkins-bot
9324b7ecc5 Merge "Drop unused patch-random-dateindex.sql" 2021-03-27 10:40:12 +00:00