Commit graph

192 commits

Author SHA1 Message Date
Brad Jorsch
c585ec5ed6 Add externallinks.el_index_60 column and indexes
This will allow for replacing the limit-and-offset queries with queries
that page in a sensible manner.

Bug: T59176
Change-Id: If5c137f68496772f3fff3a735b7b0c388426e518
2016-11-21 16:37:49 -05:00
This, that and the other
d0a0e9b417 Add primary key to change_tag and tag_summary tables
Based heavily on 43e386ca16.

Bug: T123225
Change-Id: I33480f4016812259700979f1145099744bb451d4
2016-10-02 13:02:41 +11:00
Brad Jorsch
adf9875c74 Add rc_name_type_patrolled_timestamp index
Bug: T140108
Change-Id: I382a5f0daef703a3d16fe008a5e1d1402f2c7b33
2016-07-14 12:01:04 -04:00
addshore
43e386ca16 Add id field to watchlist db table
Bug: T125990
Change-Id: I3ce3a736d51bc06fe40fd773f079e694039b4f3e
2016-02-18 21:01:01 +00:00
Brad Jorsch
2257fe4228 Revert "Remove SessionManager, temporarily"
This reverts commit 823db5d63dd5200d04c63da50ba6bf16f928e70b.

Change-Id: Ibb3e023e4eb6715295586dea87d0725c344a8271
2016-02-03 21:44:59 +00:00
Brad Jorsch
5083e810eb Remove SessionManager, temporarily
The plan here is to take it out of 1.27.0-wmf.12 and put it back in
1.27.0-wmf.13.

Since BotPasswords depends on SessionManager, that's getting temporarily
removed too.

This reverts the following commits:
* 6acd424e0d SessionManager: Notify AuthPlugin before calling hooks
* 4d1ad32d8a Close a loophole in CookieSessionProvider
* fcdd643a46 SessionManager: Don't save non-persisted sessions to backend storage
* 058aec4c76 MessageCache: Don't get a ParserOptions for $wgUser before the end of Setup.php
* b5c0c03bb7 SessionManager: Save user name to metadata even if the user doesn't exist locally
* 13f2f09a19 SECURITY: Fix User::setToken() call on User::newSystemUser
* 305bc75b27 SessionManager: Don't generate user tokens when checking the tokens
* 7c4bd85d21 RequestContext::exportSession() should only export persisted session IDs
* 296ccfd4a9 SessionManager: Save 'persisted' flag in session metadata
* 94ba53f677 Move CSRF token handling into MediaWiki\Session\Session
* 46a565d6b0 Avoid false "added in both Session and $_SESSION" when value is null
* c00d0b5d94 Log backtrace for "User::loadFromSession called before the end of Setup.php"
* 4eeff5b559 Use $wgSecureCookie to decide whether to actually mark secure cookies as 'secure'
* 7491b52f70 Call session_cache_limiter() before starting a session
* 2c34aeea72 SessionManager: Abstract forceHTTPS cookie setting
* 9aa53627a5 Ignore auth cookies with value 'deleted'
* 43f904b51a SessionManager: Kill getPersistedSessionId()
* 50c5256352 SessionManager: Add SessionBackend::setProviderMetadata()
* f640d40315 SessionManager: Notify AuthPlugin when auto-creating accounts
* 70b05d1ac1 Add checks of $wgEnableBotPasswords in more places
* bfed32eb78 Do not raise a PHP warning when session write fails
* 722a7331ad Only check LoggedOut timestamp on the user loaded from session
* 4f5057b84b SessionManager: Change behavior of getSessionById()
* 66e82e614e Fix typo in [[MediaWiki:Botpasswords-editexisting/en]]
* f9fd9516d9 Add "bot passwords"
* d7716f1df0 Add missing argument for wfDebugLog
* a73c5b7395 Add SessionManager

Change-Id: I2389a8133e25ab929e9f27f41fa9a05df8147a50
2016-02-01 22:06:49 +00:00
Brad Jorsch
f9fd9516d9 Add "bot passwords"
Bot passwords are something like OAuth-lite, or Google's application
passwords: the bot can use API action=login to log in with the special
username and password, and will then be allowed to use the API with a
restricted set of rights.

This is intended to provide an easy migration path for legacy bots and
for bots on wikis without OAuth, since AuthManager is going to greatly
complicate non-interactive authentication. If OAuth is available, an
owner-only consumer would be a better choice.

Bug: T121113
Change-Id: Iaa4015e00edbfbfaedcc8b2d27a2d3fd25009159
Depends-On: I7e15331efb162275c4116bcae61f19d6b884cbe3
2016-01-12 22:37:44 +00:00
Timo Tijhof
baf1721491 resourceloader: Remove obsolete msg_resource database table
No longer used as of 5d5b269e0e.

Change-Id: Ieb8448185cf39aa396e902e025e673f0886ac3c3
2015-12-14 01:24:27 +00:00
Timo Tijhof
cbf5bacae5 resourceloader: Remove obsolete msg_resource_links table
No longer used as of Ia9131f570.

Change-Id: If009e2620e59002e127d21b90a96bdd29e5d2a9d
2015-12-14 01:23:19 +00:00
Jeff Janes
3603b8d772 PostgreSQL: Drop unneeded foreign key constraint
Change I1c7f3a84f10df05d6b37dccbad4c8232edf51580 causes
an existing foreign key assumption (under PostgreSQL) to be
violated upon deleting a page.  This foreign key assumption does not
explicitly exist in MySQL, and is not implied via documentation.  So
it was probably never needed in the first place.

Don't create the foreign key constraint in PostgreSQL, and drop it
if it already exists when running update.php.

The constraint was previously created with an implicit name, so
drop the constraint involving the specified column name (rc_cur_id),
rather than hard-coding the name of the constraint itself.

This bug probably exists under Oracle and MSSQL as well, but no attempt
was made to address it there.

Bug: T76254
Change-Id: I2abd650c8ce83c5b725aec0545fff14a927a305a
2015-01-30 13:15:29 -08:00
Chad Horohoe
5f8edb2c0a Drop ss_total_views and page_counter fields from MediaWiki
Follows up removal of code using hitcounters in 90d90dad6

RFC: https://www.mediawiki.org/wiki/Requests_for_comment/Removing_hit_counters_from_MediaWiki_core
Change-Id: Ieeb558f9523c11965cbc1941cad4f316c00c85c5
2015-01-09 19:01:01 +00:00
Aaron Schulz
b8c038f678 Redo WhatLinksHere query and add a *_from_namespace field to link tables
* Also tweaked the query so MySQL avoids doing a page_name
  index scan when it should start with the link table index
* Added population script (triggered by update.php)
* Also removed uniqueness from some indexes where it is redundant
* Renamed two confusing variables

Bug: 60618
Change-Id: Icca99b6ae0ef76cb77695faf82c615516191da36
2014-07-21 12:04:56 -07:00
Kunal Grover
50144cd02a First version of Page Language selector
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
2014-06-27 23:27:07 +00:00
Brad Jorsch
c396f11ab3 Add wl_user_notificationtimestamp index
Bug: 65246
Change-Id: If3e9e855c8a21874ca69c4976af207833dcc53f2
2014-06-04 06:05:38 +00:00
Jeff Janes
0582e3339d PostgreSQL: Make l10n_cache.lc_value binary
Change-Id I427c6de5a0a29b43cff755db0eb8a750db620173 increases the
probability that a null byte will attempt to be stored in the
lc_value column.  PostgreSQL does not allow that byte in a text
column, so convert the column to bytea.

If the column already contains corrupted data, the upgrade routine
might fail.  To prevent this, delete the contents of the table before
changing the type.

Bug: 62098
Change-Id: Ie8368bde398b2ae4d3cfc9ee7bf35874bd2ded68
2014-05-05 11:20:52 -07:00
Jeff Janes
3fcfced5ad PostgreSQL: Fix syntax error in page_props index
Follows up I217c42656fb877ff35a36eb446a22bdaf119faac

That change introduced a syntax error during update.  I have verified
that this fixes the syntax problem so that update.php runs, but have
not verified that the new functionality behaves as intended.

Also, the PostgreSQL schema changes introduced during the update
process were not present at all in a fresh install to PostgreSQL.  Add
analogous changes to tables.sql.

Bug: 64807
Change-Id: I736344839ec478216402fdfe260968afbd663498
2014-05-05 10:14:02 -07:00
Jeff
8e4b41a508 PostgreSQL: Allow rc_cur_time field to be null.
The column recentchanges.rc_cur_time is no longer populated by SQL,
so PostgreSQL must be changed to allow the NULL value for it.

In MySQL, the empty string is used as a surrogate for NULL, but that
is not allowed in PostgreSQL.

Bug: 61318
Change-Id: I6733ef11152d545382bec087d992515dcf9aec0b
2014-04-22 16:57:49 +00:00
umherirrender
2ba577f69c Add missing DROP SEQUENCE to postgres' tables.sql
To drop all possible existing sequences.
Also add a DROP TYPE for the existing type.

Change-Id: I3aad6b1c6c2b273ca4ed5fd3b448f4379984cd76
2014-02-28 23:10:23 +01:00
csteipp
01c8c421f8 Password Expiration
Add functionality to expire users' passwords:
 * Adds column to the user table to keep a password expiration
 * Adds $wgPasswordExpirationDays, which will force users to reset
   their passwords after a set number of days. By default, this set
   to false, so passwords never expire.
 * Adds a default grace period of 7 days, where if the user's password
   is expired, they can still login, but are encouraged to reset their
   password.
 * Adds hook 'LoginPasswordResetMessage' to update reset message, in
   case an extension wants to vary the message on a particular reset
   event.
 * Adds hook 'ResetPasswordExpiration' to allow extensions to change
   the expiration date when the user resets their password. E.g., if
   an extension wants to vary the expiration based on the user's group.

If the user is in the grace period, they get a password reset form
added to the login successful page. If an extension prevents showing
the login successful page (like CentralAuth), it should be updated to
show a password change form during the grace period. After the grace
period, the user will not be able to login without changing their
password.

Also prevents a successful reset if the user is "changing" their
password to their existing password.

No passwords will expire by default. Sites will have to call
User->expirePassword() from their own maintenance script to trigger a
password reset for a user.

Bug: 54997
Change-Id: I92a9fc63b409b182b1d7b48781d73fc7216f8061
2014-02-20 09:41:51 -08:00
jenkins-bot
7af7ba2f05 Merge "Add missing uploadstash.us_props for PostgreSQL" 2014-01-29 18:19:48 +00:00
umherirrender
305622fbc9 Correct sequence name for fresh Postgres installation
Spotted by gebhkla on bug 60083

Bug: 60083
Change-Id: I34283c2539f4ce9d1b85756b3e1c16d255000ed5
2014-01-27 20:38:59 +01:00
Aaron Schulz
b57e457091 Added a page_links_updated column for job de-duplication
Change-Id: I74b6f507ef7371db92e0c3f058d38c0ca5dea9ef
2013-12-24 10:54:32 +00:00
Jackmcbarn
65a304c444 Add index on logging.log_user_text
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
2013-12-19 03:13:05 +00:00
saper
c7f4586fe1 Add missing uploadstash.us_props for PostgreSQL
This field was introduced in e5d41cca90
but only for MySQL.

Change-Id: I057b1dd845a5ab7ae05f5597454981a6e2c12698
2013-12-09 20:46:17 +01:00
Erik Bernhardson
6bbd4bca6c Revert "Revert "Add new recentchanges field rc_source to replace rc_type""
This reverts commit 113f49bb21 after the
schema change has been completed.

Change-Id: I5412466444526986e1209d0982dd62cd5b387ad1
2013-10-25 13:10:42 -07:00
tisane
9b2b027ba7 Add archive, externallinks PK
* 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
2013-10-17 18:43:40 +01:00
jenkins-bot
3316e073a8 Merge "Revert "Add new recentchanges field rc_source to replace rc_type"" 2013-10-17 00:37:44 +00:00
Reedy
113f49bb21 Revert "Add new recentchanges field rc_source to replace rc_type"
No feature flag, and also not deployed on WMF wikis. Asking for schema changes by the time we branch tomorrow is just unfair

This reverts commit e478c230f6.

Change-Id: I125c30e76fa04679cc04ae7b8728ae3a61f35194
2013-10-17 00:32:40 +00:00
jenkins-bot
7c47d3f66a Merge "Add new recentchanges field rc_source to replace rc_type" 2013-10-16 23:33:37 +00:00
Erik Bernhardson
e478c230f6 Add new recentchanges field rc_source to replace rc_type
The existing field to differentiate between kinds of recentchanges rows is
the rc_type field. We want to allow extensions to insert their own custom
data into recentchanges, but we have learned via the NS_* series of constants
that requiring extensions to "register" a specific number is very error prone.

The solution, which this commit implements the first phase of, is to utilize
a new 16 byte string field rc_source.  Within that field change types will be
prefixed strings such as 'mw.edit' and 'mw.new'.

This commit adds the new field and begins populating it with data.  At some
point in the future the rc_type field will be dropped.  While WMF wiki's will
simply wait out the 30 day recentchanges history, other wiki's have the option
of letting update.php populate rc_source, or manually applying the db change and
utilizing the PopulateRecentChangeSource maintenance script.

Change-Id: Iaddd6c446373a68d31586ed54346db7d04e13b2c
2013-10-16 11:35:20 -07:00
Jeff Janes
64fbe6a89b In maintenance/postgres/tables.sql, the profiling table should be defined like
this:

CREATE TABLE profiling (
  pf_count   INTEGER         NOT NULL DEFAULT 0,
  pf_time    FLOAT           NOT NULL DEFAULT 0,
  pf_memory  FLOAT           NOT NULL DEFAULT 0,
  pf_name    TEXT            NOT NULL,
  pf_server  TEXT            NULL
);

The current use of NUMERIC(18,10) very rapidly overflows the pf_memory column,
generating errors.  Also, the NUMERIC is very much slower than float, and in
this case it has no advantages.

Bug: 55722
Change-Id: I48b00d55aaed821a4ceb9365033817a3b477d71a
2013-10-15 20:19:10 +00:00
Jesús Martínez Novo
3d8bfee35b drop unused fields rc_moved_to_ns/rc_moved_to_title
Follow-up I68e8c0bb23f185c0f996a8905f6d437db3080aa1

Deleting those fields also from tables.sql definition
for mssql, oracle and postgres

Bug: 34960
Change-Id: I1867536c9161abed0b23428d3c840d16a05cba56
2013-09-21 02:46:13 +00:00
Chad Horohoe
36cade5fe8 Remove ExternalUser authentication code
This was an experimental authentication system intoduced a couple
of years ago with a pretty narrow use-case. It's been pretty much
ignored since introduction, and makes login more complicated than
it needs to be.

I didn't drop the external_user table on the off-chance someone
out there actually has data in it, but they should use AuthPlugin
for their external authentication needs.

Change-Id: I794338dbb75961ee033d41fa44bb7aa22e54f447
2013-04-04 10:09:34 -04:00
Brad Jorsch
c013ec02b9 (bug 36400) API: Fix sorting for iwlinks, langlinks
The iwlinks and langlinks modules continue parameters imply ordering by
page then prefix then title. But in certain modes, the actual queries
use a different ordering, which may result in skipped or repeated
results.

This changeset fixes that. To do so, it needs to re-add an index
iwl_prefix_from_title which was mistakenly removed in 2010 (r69721). And
while it's doing that, it cleans up errors in the sqlite and postgresql
handling of the iwlinks indexes too.

Also, per Asher, make the iwl_prefix_from_title and
iwl_prefix_title_from indexes non-UNIQUE.

Change-Id: I607e8bf9183a2d8152a6127a81c83a0b5bba0c61
2013-04-03 13:22:20 -04:00
jenkins-bot
ed4db4af0a Merge "Add pp_propname_page index to page_props" 2013-02-25 22:54:48 +00:00
jenkins-bot
2152738bca Merge "Include Postgres tables and maintenance scripts for Change I23c47c2c" 2013-02-02 11:07:57 +00:00
Brent Garber
4509c1111e Include Postgres tables and maintenance scripts for Change I23c47c2c
Change-Id: I1b2fe2b80700678935bf6d28c3a48538d044d3f4
2013-02-01 20:09:40 +00:00
Tim Landscheidt
5421548819 Add column job_attempts and index job_cmd_token_id to PostgreSQL.
* (bug 43416) This ports cd000590ee.

Change-Id: I3d4c7d906f6465b3a054df2fc0cd8f564173ed2b
2013-02-01 11:45:37 -08:00
Brad Jorsch
bc4c2ef32d Add pp_propname_page index to page_props
This adds an index to page_props to support looking up pages using a
particular property.

Change-Id: Iea778eb783e1d4a46fb0549dfd84915477cac5df
2013-01-21 22:08:10 +00:00
Reedy
cc18322559 Back out config table and related code
Change-Id: I4fa180d45984a4ec2b2c7b1149015c6dad14c5f0
2012-10-29 15:17:24 +00:00
Tim Landscheidt
a4193673b2 Add additional job columns to PostgreSQL as well.
This ports I49824c7fa855fea4ddcac5c9901ece8c2c0101d0 and fixes
bug #41196.

Change-Id: I18e0ac3aee2c2627f89d28d4a34afd90c822af91
2012-10-24 18:56:54 +00:00
Tim Landscheidt
b5df3f37d1 Add filearchive.fa_sha1 to PostgreSQL as well.
This fixes bug #41114.

Change-Id: I021070f90d35d99ad55944543e94004f62d5f08c
2012-10-20 03:37:53 +00:00
freakolowsky
287bf0db12 Add *_content_(model|format) fields to PostgreSQL
Create ContentHandler field for PostgreSQL
(for installer and the update).

TEXT was chosen as replacement for MySQL VARBINARY(32)

Change-Id: Ia86ae79d37517630e1767dfb976604bbb174104b
2012-10-11 20:53:16 +00:00
Marc A. Pelletier
7694faf68f (bug 5445) remove autoblocks when user is unblocked
Previously, whenever we blocked a user, its IP address would be
autoblocked whenever he tries to edit a page. Thus when later unblocking
the username, he would be automatically blocked again if we forgot to
clean up is IP.

This patch introduces a the ipb_parent_block_id column in ipblocks table
to track which block triggered the autoblock command. Thus, when deleting
the original block we can easily remove all subsequentautoblocks.

Schema updaters for MySQL, SQLite and postgres have been added to the
patch but not for the other database types such as ibm_db2, mssql and
Oracle.

Change-Id: I4aa820ae9bbd962a12d0b48b6c638a1b6ff4efc9
2012-05-03 12:07:30 +02:00
Greg Sabino Mullane
98b9296303 PostgreSQL schema: datatype updates, remove unused column, add table
* More allowed data type conversions from MySQL to PostgreSQL
* Allow for data type SMALLINT: seen for first time!
* Handle CREATE TYPE: check for dupes, and allow the name as a valid data type.
* Remove the now-deprecated user_options column.
* Add new table "config"

Change-Id: I18e67bcb131b88bfaea7e736f302dd79ebfc9b82
2012-04-04 09:15:51 -04:00
OverlordQ
351332641a Followup to r107866, add in new job_timestamp field which was likely completely breaking anything related to the job queue, should fix failing TemplateCategoriesTest.testTemplateCategories on PG 2012-01-12 22:11:12 +00:00
OverlordQ
44ce86ac01 Followup to whatever revision added us_chunk_inx 2012-01-12 17:10:48 +00:00
Chad Horohoe
7914b2ee68 (bug 29475) Remove "trackback" feature entirely from core. This has been disabled-by-default since its inception and nobody uses it.
If someone really really wants this, they can write an extension.

Language files need rebuilding, but I took care of En and messages.inc.
2011-11-23 17:14:03 +00:00
OverlordQ
0074526857 Followup to r100640, use correct name scheme for sequence, correct references to sequence and add optional patch file for sites following trunk 2011-11-16 19:54:38 +00:00
OverlordQ
608d6bba76 Followup to r101021, add back to Pg schema so we can install mediawiki 2011-10-31 20:03:43 +00:00