Update the database schema so a block can be switched between a sitewide and
partial block. Also add the restrictions table for specifiying the partial
blocks.
Bug: T197144
Change-Id: I4a725312c4b980a1b14e5ca826069fa2278a5913
Since update.php will eventually be dropping the old columns and fields,
we should make sure the migration script gets run first.
Bug: T197818
Change-Id: I47f5ba4e21b4fe2ef0beb9fc83896cd4b0a0d505
To follow up I39b0825c, this change replaces the existing non-unique
index on the column with a unique index, to help avoid some of these
sort of bugs in the future.
Bug: T193180
Change-Id: I932478c9c6a13210bc9dff75286d0f08da56682c
Old bugs and such may have left the archive table with multiple rows
using the same ar_rev_id, or rows that also exist in the revision table.
These need to be cleaned up for MCR.
The maintenance script added here will delete rows that appear to be
duplicates of the same change, and will assign new IDs to rows that do
not appear to be duplicates.
Bug: T193180
Change-Id: I39b0825c9469e074ded3df33a4f06a1ef0edb494
Adds a maintenance script to populate the field, has that be
automatically run during update.php, and drops the no-longer-needed
default value on the column (where possible: mssql has some sort of
constraint thing going on that I have no idea how it works).
Bug: T59176
Change-Id: I971edf013a1a39466aca3b6e34c915cb24fd3aa7
Table defining tag names for IDs. Also stores hit counts to avoid expensive queries on change_tag
See T185355 for more information
Bug: T193867
Bug: T185355
Change-Id: I4fd943589b3ed304471304c8beda15327a8edbcf
Revisions deleted before MediaWiki 1.5 do not have a value in this
field. This is going to be a problem for migration to the MCR schema, so
provide a maintenance script to clean this up.
Then, for good measure, change the schema to make the field
non-nullable.
Bug: T182678
Change-Id: Ie2e11f12a30f379db32c3e074658012c6f93adb0
The site stats table holds a bunch of metric fields, two of which are of
data type "bigint unsigned", 3 are "bigint" (signed) and one is int
(signed). Also the default values differ widely: It is 0 on the
"unsigned" fields and the "int" field, but -1 on the three others. This
patch makes all of this more consistent:
Set all fields (except the ss_row_id, which isn't changed) data type to
"bigint unsigned". Also set NULL as the default value for all those
fields. Obviously -1 isn't a possible default value any more. Also, 0
can easily be mistaken for a real value (e.g. ss_active_users=0 -->
"there is nobody active on this wiki"). NULL, by it's definition, is the
value of choice for a value to insert into fields of which we don't know
a correct value.
The respective patch files were tested locally against MySql, Sqlite,
Postgres and SQL Server 2016. Neither oracle nor the upgrade with
update.php was tested.
Bug: T56888
Change-Id: I7d42aae434852a56b6f8dd559d8a5f3bce416021
This begins the process of merging image_comment_temp into the image
table by adding the needed column. Iab5f5215 will adjust the code
to use it and to add the necessary migration script.
Note this patch puts the new schema change in the 1.30 section rather
than the 1.31 section. This allows Iab5f5215 to have migrateComments.php
migrate the comments directly to the new field instead of having to
populate and then depopulate the temporary table.
Bug: T188132
Change-Id: I2485c5a758bf03bb2b4991eea920abd9d0d30bda
Storing the user name or IP in every row in large tables like revision
and logging takes up space and makes operations on these tables slower.
This patch begins the process of moving those into one "actor" table
which other tables can reference with a single integer field.
A subsequent patch will remove the old columns.
Bug: T167246
Depends-On: I9293fd6e0f958d87e52965de925046f1bb8f8a50
Change-Id: I8d825eb02c69cc66d90bd41325133fd3f99f0226
Follows up Ic3a434c06.
Add schema for MSSQL and Oracle, and add a missing 'migrateComments'
call for PostgreSQL.
Bug: T166732
Change-Id: I408085db17bf951ce721427e7344b4afd5706e40
This really should have been done a very long time ago.
This adds a maintenance script to migrate rows with ar_text_id null to
modern storage, either the text table or ExternalStore.
Bug: T36925
Change-Id: I5608c6b6d3ecad516b785e13d668427c1b762e41
Schema additions/updates for MySQL, SQLite, PostgreSQL, MSSQL
and Oracle to add new tables:
* content
* content_models
* slots
* slot_roles
See also https://www.mediawiki.org/wiki/Multi-Content_Revisions/Database_Schema
Bug: T174028
Change-Id: I30a3a9834d54d0e6957553d91908b2b73b2c802f
As discussed in I7d42aae434852a56b6f8dd559d8a5f3bce416021 primary keys
are needed to perform various schema changes on the site_stats table.
This patch aims to introduce primary keys for all supported dbms.
The respective *.sql patch files were tested locally against Postgres
and SQL Server 2016. Please note that neither the patch file for Oracle
DB nor the mediawiki upgrade through update.php was tested.
Bug: T56888
Change-Id: Id10e221f0dc120bc09afc22596fd1dbecbf6a61d
It's often forgotten because MySQL and Sqlite don't use it, the only
users are PostgreSQL and Oracle. And when used, if inserts to multiple
tables are being done it's easy to get the ordering wrong.
This patch reimplements DatabasePostgres::insertId() in terms of PG's
lastval() function, and adds triggers to the Oracle schema to make it
work the same as the other databases.
Bug: T164900
Change-Id: Ib308190c52673a9266c8495a589ae644f9fbefce
This patch adds an ug_expiry column to the user_groups table, a timestamp
giving a date when the user group expires. A new UserGroupMembership class,
based on the Block class, manages entries in this table.
When the expiry date passes, the row in user_groups is ignored, and will
eventually be purged from the DB when UserGroupMembership::insert is next
called. Old, expired user group memberships are not kept; instead, the log
entries are available to find the history of these memberships, similar
to the way it has always worked for blocks and protections.
Anyone getting user group info through the User object will get correct
information. However, code that reads the user_groups table directly will
now need to skip over rows with ug_expiry < wfTimestampNow(). See
UsersPager for an example of how to do this.
NULL is used to represent infinite (no) expiry, rather than a string
'infinity' or similar (except in the API). This allows existing user group
assignments and log entries, which are all infinite in duration, to be
treated the same as new, infinite-length memberships, without special
casing everything.
The whole thing is behind the temporary feature flag
$wgDisableUserGroupExpiry, in accordance with the WMF schema change policy.
The opportunity has been taken to refactor some static user-group-related
functions out of User into UserGroupMembership, and also to add a primary
key (ug_user, ug_group) to the user_groups table.
There are a few breaking changes:
- UserRightsProxy-like objects are now required to have a
getGroupMemberships() function.
- $user->mGroups (on a User object) is no longer present.
- Some protected functions in UsersPager are altered or removed.
- The UsersPagerDoBatchLookups hook (unused in any Wikimedia Git-hosted
extension) has a change of parameter.
Bug: T12493
Depends-On: Ia9616e1e35184fed9058d2d39afbe1038f56d7fa
Depends-On: I86eb1d5619347ce54a5f33a591417742ebe5d6f8
Change-Id: I93c955dc7a970f78e32aa503c01c67da30971d1a
This will allow for replacing the limit-and-offset queries with queries
that page in a sensible manner.
Bug: T59176
Change-Id: If5c137f68496772f3fff3a735b7b0c388426e518
There are already version comments for the older versions, so also
adding comments for the current version to make it easier finding the
corresponding version when looking at database changes.
As suggested in Ieeb558f9523c11965cbc1941cad4f316c00c85c5
Change-Id: Idf4f52aec4eeb73ec2f830d7d7eaab84c73b6d95
Special page PageLanguage to set the page language of a page.
To enable the feature, set $wgPageLanguageUseDB to true
and assign the 'pagelang' user right to a user group.
Bug: 35489
Change-Id: I0f82b146fbe948f917c1c5d29f7469644d797e80
pp_sortkey was added with I217c42656fb877ff35a36eb446a22bdaf119faac,
which is part of 1.24, so adding the comment before that.
Change-Id: I7b970705ad7de75cb9542f8a5a963697386940a7
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.
Change-Id: I3595e9aac69ac42fbb74b0783fae0ad9bcc831aa
(rebase)
also fixed wrong definition of password expire filed
DEFAULT was unnecessary and faulty (has to be before
NULLABLE clause)
and changed the null-user insert
Change-Id: Ia91ed19bd4e3380f396ef895745dbd2014e1eb8b
Fixing bug #54404 requires querying against logging.log_user_text, which
is currently unindexed. Add an index, to prevent performance from being
adversely affected by the fix.
Bug: 54432
Change-Id: I6b2af65c75bbee57377cb1ec2e75ea41a5091f80
They can cause problems if, for example, the installation has hooks
for UserSaveSettings or UserSaveOptions that try to update a user page.
Change-Id: I31078678e8939c897b1357bcb77eb2d26f806f29
Bug: 47271
One class of errors left unaddressed: Class name "WebInstaller_Language"
is not in camel caps format. I think this can be changed, too, but I
wasn't able to quickly find out where class names are being created.
Change-Id: I920b0231db1b70b68c6c8907257c288a0e112668
* New fields: ar_id, el_id. el_id is presently not used for
anything, but will help with online schema changes.
Bug: 15441
Bug: 39675
Change-Id: Ib6b0fc3736d173fa4ba7b786ecfc710b2f4711bb
Previously OracleUpdater::doPageRestrictionsPKUKFix had the
database prefix hard-coded into the SQL query. This removes
the hard-coded value and replaces it with the actual configured
prefix.
Change-Id: If60f23af7fd238d4c91ebf25b095749345a2718d
And added/removed spaces around some other tokens,
like +, -, *, /, <, >, =, !
Fixed windows newline style
Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8