Commit graph

180 commits

Author SHA1 Message Date
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
OverlordQ
8cd73f35ff Update Postgres with missing uploadstash tables 2011-10-24 19:43:16 +00:00
Aaron Schulz
a4d029210a Follow-up r90749:
* Removed useless ufg_group index from user_former_groups
* Index name consistency
2011-06-25 04:11:20 +00:00
Aaron Schulz
cb6b72cef7 Added one-time promote support via Autopromote::autopromoteOnceHook function. This is still a bit rough on the edges. This uses a hook since extension may want to control when it's called for performance reasons. Patch by lampak. (for bug 24948) 2011-06-25 02:52:30 +00:00
Brion Vibber
5f0afcf1a2 Breaking the 'math' table setup out to Math extension. Should be the last main step in extension-ification of the math options!
The 'math' table will no longer be created on a default install unless you've explicitly enabled the Math plugin at install time; the usual update.php procedure will add it in.

Postgres, Oracle, MSSQL, and DB2 variants are included -- broken out from the core files -- but have not been tested.

I know there has been some code duplication in parser test infrastructure but could only find one instance of the parser test temporary table setup to remove the 'math' table from (the extension adds it back via the hook). If the phpunit-based runner breaks, please track it down and fix it there too.
2011-04-22 21:37:16 +00:00
Mark A. Hershberger
13e7d428b1 followup r13884 add CASCADE so that if the tables are created a second
time, errors aren't given.
2011-02-05 22:20:09 +00:00
Mark A. Hershberger
1eb2307caa Results of my work on new-installer and Pg.
* NOTE: this commit removes any semblence of tsearch compatibility with pre-8.3 PostgreSQL
* Make new-installer work against PostgreSQL
* Remove SearchPostgres.php's call to pg_fetch_result.  I think this is the only one outside of the vestigtial old installer code.
2011-02-03 04:06:11 +00:00
Greg Sabino Mullane
a159977153 Use text_pattern_ops for page_title, as some code uses 'anchor%' matching. 2011-01-19 16:14:37 +00:00
Greg Sabino Mullane
cb1c5fd26b Add new index on pagelinkes(pl_title) per suggestion from bug 25111 2010-09-13 15:04:04 +00:00
Greg Sabino Mullane
da86748730 Add new tables. 2010-09-08 02:02:28 +00:00
Greg Sabino Mullane
7eac02fe48 Bump cl_collation from smallint to a text 2010-09-03 21:08:16 +00:00
Greg Sabino Mullane
0426d84d21 Add in new categorylinks columns. 2010-08-31 14:35:56 +00:00
Greg Sabino Mullane
f31556261f CREATE LANGUAGE belongs as part of the installer, not here. 2010-08-24 17:35:03 +00:00