Commit graph

151 commits

Author SHA1 Message Date
Reedy
4b6ebd5c01 Fix file permissions from Ic7fc3bd836241dce8f296237bbd80ed3e4d1ee0d
Change-Id: I5d147c6baa034057f95e69b78811b9011cc4355e
2014-06-30 15:31:47 +01:00
rillke
a3f7117f8d Name implicitly created CHECK constraints
to ease future maintenance work. The pattern for catching the right
CHECK constraint is admittedly vague but the order in which auto-created
CHECK constraints of a table is removed doesn't really matter assuming
the update is always completed before another update is applied. If
updates are run through Update.php, that should be always the case.

Furthermore eliminating a bug causing application of several patches each
time when running Update.php

Bug: 65757
Bug: 65813
Change-Id: Ic7fc3bd836241dce8f296237bbd80ed3e4d1ee0d
2014-06-29 22:05:03 -03:00
umherirrender
f5f1e38b9a Fixed some @params documentation (includes/[db|installer])
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
2014-04-19 13:55:27 +02:00
Brian Wolff
0bf4b4ec4f Output info in update.php for skipped updates due to shared tables
Can be kind of confusing for people to figure out why certain
updates didn't happen. I just had an irc conversation with
someone who didn't realize why their db wasn't fully updated.

Change-Id: I56223e70bdac8baaf079c28cbb1f0e20ef0336b8
2014-04-16 17:45:26 -03:00
Thiemo Mättig
2aa67db39d Fix "@param null $param" documentations
... and very few other documentation details that are closely connected
to these mistakes.

Change-Id: I5b2691948e196124c77f0cc04d0ed5a7167cac25
2014-04-09 12:33:55 +02:00
umherirrender
f153998317 Fixed spacing
- Removed double spaces
- Added space after if/switch/foreach
- Removed space on elseif
- Added space around parentheses
- Added newline at end of file
- Removed space before semicolon at end of line

Change-Id: Id40b87e04786c6111e6686d7f7eea1e588bdf37d
2013-11-19 19:03:54 +01:00
jenkins-bot
547c7eacde Merge "Update documentation" 2013-11-06 16:20:21 +00:00
Mark A. Hershberger
08d3afc971 Disable $wgContentHandlerUseDB during upgrade where fields don't exist.
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
2013-11-01 18:26:21 +00:00
Siebrand Mazeland
8a7d5c154b Update documentation
Change-Id: Ia8ca4f3ab49e8a437830a9d15d013e9ddb0ea3ab
2013-11-01 12:40:08 +01:00
Siebrand Mazeland
bb0044f638 Address PHP CodeSniffer errors and warnings
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
2013-10-23 12:42:07 +00:00
Siebrand Mazeland
626addab9e Update formatting
With some manual corrections.

Change-Id: Icd947288c32fdb90a0f35388963ef5a17ffa58e7
2013-10-09 09:35:18 +00:00
umherirrender
037d375e0d update.php clears caches twice
There was a bad rebase on I96b4cfd4c02e9cbf46cc6a0499b87fb3b89020a0,
because it partically reverts Ice42a31dee1e6b41da4aa0a47e8786579382aff1

Bug: 44690
Change-Id: Iff2c8d3cb1a10da7cd0ab18ee189454761d7db6f
2013-09-21 03:37:02 +00:00
Timo Tijhof
50e7985d4d phpcs: Fix WhiteSpace.LanguageConstructSpacing warnings
Squiz.WhiteSpace.LanguageConstructSpacing:
   Language constructs must be followed by a single space;
   expected "require_once expression" but found
   "require_once(expression)"

It is a keyword (e.g. like `new`, `return` and `print`). As
such the parentheses don't make sense.

Per our code conventions, we use a space after keywords like
these. We appeared to have an unwritten exception for `require`
that doesn't make sense. About 60% of require/include usage
was missing the space and/or had superfluous parentheses.

It is as silly as print("foo") or return("foo"), it works
because keywords have no significance for whitespace between
it and the expression that follows, and since experessions can
be wrapped in parentheses for clarity (e.g. when doing string
concatenation or mathematical operations) the parenthesis
before and after basiclaly just ignored.

Change-Id: I2df2f80b8123714bea7e0771bf94b51ad5bb4b87
2013-05-09 05:56:26 +02:00
umherirrender
dbd0b590e9 else if -> elseif
Also fixed some spacing while at it
Added some braces for one line statements

Change-Id: Iebfa2b17091509daabc76248121c7763e2295d20
2013-04-17 16:52:47 +02:00
Tyler Anthony Romeo
eca5c5007e Cleared ResourceLoader blob store after update.php finishes.
Update.php is supposed to clear all localization caches. This
makes sure to clear the ResourceLoader's own message cache
as well.

Bug: 44524
Change-Id: I15ceb60f5e2e4d3ed9ba818fe6cd619f9adce5b2
2013-04-09 18:14:57 +00:00
umherirrender
6c278b6d7e fix some spacing
* Removed spaces around array index
* Removed double spaces or added spaces to begin or end of function
  calls, method signature, conditions or foreachs
* Added braces to one-line ifs
* Changed multi line conditions to one line conditions
* Realigned some arrays

Change-Id: Ia04d2a99d663b07101013c2d53b3b2e872fd9cc3
2013-03-25 22:22:46 +00:00
umherirrender
926d2ee143 Remove spaces between parentheses in function calls
Change-Id: If8ec665a01b566fa5189dfcc810b2d9a17f371e1
2013-03-17 16:13:22 +01:00
Tyler Anthony Romeo
4dcc7961df Fixed @param tags to conform with Doxygen format.
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.

Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
2013-03-11 13:15:01 -04:00
Reedy
c3e4057e06 Kill off numerous unused variables
Change-Id: I7039f1328f37ee669b694f73ee282602186bffd1
2013-03-08 02:36:24 +00:00
umherirrender
48cd72819e fix some spacing
Change-Id: Ia9650be8b791fd2f0ccbc099436918a9d12d9968
2013-02-04 20:04:26 +00:00
umherirrender
fac189e26a The abstract declaration must precede the visibility declaration
From phpcs

Change-Id: I169c80a911ba75d64ab8a503088903ce3b8a7cca
2013-01-26 20:00:09 +01:00
Reedy
3ae75526ef Add "modifyExtensionField" utility function
As calling $updater->modifyField will do the action immediately (not queued),
this may be undesired.

So this is a shortcut/utility function like addExtensionField/addExtensionTable etc,
instead of the developer calling addExtensionUpdate( array() ) themselves.

Change-Id: Ie94f2b42679062c6e106ae560faab26818a9b15c
2013-01-06 03:03:36 +00:00
Alexandre Emsenhuber
692a5d16f5 Some fixes for Ia2782d64 (2f60cd2)
- Add doTable() check at the top of renameIndex()
- Return true instead of false when aborting an update due to unfulfilled
  condition; false is only to be used for updates that will be written to
  a schema update file to be run later
  Also removed the return false from addIndex() for consistency
- Break long line

Change-Id: I2efb6e3af4703ed8afeb315e8cda774d9a6c4a32
2013-01-05 20:31:35 +01:00
Dereckson
2f60cd20b6 New methods to drop or rename extension index in DatabaseUpdater
- DatabaseUpdater::dropExtensionIndex( $tableName, $indexName, $sqlPath )
- DatabaseUpdater::renameExtensionIndex( $tableName, $oldIndexName, $newIndexName, $sqlPath, $skipBothIndexExistWarning = false )

[ Case use ]

This feature is required to help extensions schema change to ensure
compatibility with SQLite.

First extensions to use it will be Echo and Flagged Revisions.

Change-Id: Ia2782d644593ab6b64b67720ed61b3994db10346
2013-01-05 20:05:41 +01:00
Alexandre Emsenhuber
5622654824 (bug 43116) Don't run database updates for shared tables unless --doshared is provided
Added DatabaseUpdater::doTable() to check whether updates should executed on the given table.

Change-Id: I83fd722b604f9bc8a834681d234a0d80964dedc5
2012-12-27 18:37:40 +01:00
IAlex
3b0f9bfe28 Merge "Tidy up some unbalanced returns in methods" 2012-12-09 09:48:40 +00:00
Reedy
d0a242abb4 Tidy up some unbalanced returns in methods
Leave a TODO

Change-Id: Ic49ac8630650b341aafb3c17abd22f3a07805d27
2012-12-09 02:59:04 +00:00
Reedy
452c73060c Move insertUpdateRow call before return applyPatch to make it reachable
This might not be quite right... We might want to cache the result of apply patch, insert the row and then return the result...

Change-Id: Ie6a1bb16d2912ad43aa8fd45b2bf10a8bf8652ae
2012-12-09 02:33:51 +00:00
Brad Jorsch
331da5d471 (bug 42483) Avoid serializing database object in update.php
Change I96b4cfd4 changed the data being stored in updatelog, trying to
store the mangled parameters (which may included an added copy of the
DatabaseUpdater object itself) instead of the input parameters. This
causes warnings because database objects cannot be effectively
serialized.

Go back to storing the original input parameters instead.

Change-Id: I96e6dffed98772ebb9b812773ff2f608e7e40cb1
2012-12-03 15:27:25 -05:00
MarkAHershberger
34c9bca6a8 (bug 38110) provide a way to separate out schema changes
Allows update.php to be run when $wgAllowSchemaUpdates = false.

This is useful for non-WMF environments where strict DB permissions
allow database updates (which update.php performs), but no schema
changes (such as adding or dropping tables or indices which update.php
also performs).

It does this by adding the --schema and --noschema flags. Without
either of these flags, update.php will perform exactly as before.

With --noschema, all changes to the table structure or table additions
are skipped. Only data changes are made.

With --schema is used, no schema changes are made to the database, but
the schema changes are saved to a separate SQL file that can be run.

Change-Id: I96b4cfd4c02e9cbf46cc6a0499b87fb3b89020a0
2012-11-21 22:53:24 -05:00
Chad Horohoe
ee01bb0d94 Move cache purging out of doUpdates()
It makes a whole lot more sense to run this at the end of the
update process after post update maintenance rather than just
at the end of schema updates.

Run update.php more than once so all the updatelog entries
are populated and you'll see why it makes sense.

Change-Id: Ice42a31dee1e6b41da4aa0a47e8786579382aff1
2012-10-25 14:21:34 -04:00
umherirrender
fb2c1c645b Add separate fa_sha1 field to filearchive table
This allows sha1 searches with the api in miser mode for deleted files

Added script to populate the rows
Adding new field to selects and handle it in all places, where needed

Using a 10 byte index for the new field per
http://lists.wikimedia.org/pipermail/wikitech-l/2012-September/063429.html

Change-Id: Ie54a513fe361202e63df44be44a0fdd91926c974
2012-10-14 20:58:25 +02:00
umherirrender
b887cea9d1 PostDatabaseUpdateMaintenance: childs checks updatelog already
The parent class LoggedUpdateMaintenance of each update script is
checking the updatelog self.

Checking in update.php prevents the script to be run, when using --force
on update.php and updater is not outputting a skipped message

Change-Id: I6cdad807ee4e49983cedef168d4e697a5bd8b7e7
2012-10-12 20:52:29 +02:00
jeroendedauw
430b31415f Replace remaining Array occurences with array
Change-Id: Id7c2fdd6814a8239acbe050d857b56350e691a49
2012-10-05 16:11:54 +02:00
Hoo man
8ffbb077b3 Use __DIR__ instead of dirname( __FILE__ )
Removed left over uses of dirname( __FILE__ ) to __DIR__, even in comments.
Running the PHP version test in maintenance/Maintenance.php earlier, so that
we no longer have to stay PHP < 5.3 compatible in there.

Change-Id: I5a00bd5c6af44b7f826c4e5576a7b3de7b5026d8
2012-08-27 23:58:28 +02:00
jeroendedauw
bdaee6f659 Enable dropping of tables without having to create a file for each if you want correct output in the console
Change-Id: I374885517928430d00446b9711ea5005f58dc2a1
2012-08-23 22:43:20 +02:00
Mark A. Hershberger
1692e46c7c Clean up applyPatch() usage in the installer.
Change-Id: I4b25c16a1cd3813fe216ea8bcf46cca2fc54d943
2012-08-18 14:13:43 -04:00
Alexandre Emsenhuber
09bb6975c5 Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: I1615bf268515ed7169e33173cea6ec30402451dc
2012-05-06 07:50:15 +02:00
Reedy
2edbe14e39 Normalising return statements
Add/improve parameter documentation

Change-Id: I4c7fa319be60a47b7fcd81131458577bccb009fb
2012-04-27 16:40:14 +01:00
saper
f752cf8042 Fix PostgreSQL updater to produce 1.19 schema
* PostgresField now reports column default value
* DatabasePostgres::indexAttributes reports index
  details
* Perform schema update in one transaction

With this change we can sucessfully update
MediaWiki 1.7.3 schema to trunk^Wmaster

Patch set 2: Rebased against master. PLEASE check carefully
to make sure I got those conflicted files right.

Conflicts:

	includes/db/DatabasePostgres.php
	includes/installer/PostgresUpdater.php

Change-Id: Iebb6855e8f6f44470bbb1dc5ab9ac1abb513adfe
2012-04-10 12:59:21 -04:00
Thomas Gries
c049019039 follow up r113862 . changed public function name extensionTableExists to tableExists 2012-03-17 08:22:58 +00:00
Thomas Gries
dd1c93ad1d follow up r113836 typo correction in function header dropExtensionTable 2012-03-14 21:53:30 +00:00
Thomas Gries
2196451495 follow up r113836 added public function extensionTableExists. 2012-03-14 21:41:37 +00:00
Thomas Gries
1fc9bcb398 adding two public convenience function wrappers: dropExtensionField and dropExtensionTable 2012-03-14 20:16:32 +00:00
Jure Kajzer
e0b634333f * Oracle schema update to latest (tested with phpunit)
* Fixed a message typo in DatabaseUpdater
2012-01-24 09:48:26 +00:00
Antoine Musso
eb43a7e8b4 (bug 32508) Fix updater output
site_stats updated is still a database action.
Purge cache is now the very last one.

Output:

	<snip>
	...site_stats is populated...done.
	Purging caches...done.

	Done.
2012-01-12 10:59:13 +00:00
Sam Reed
cf545ef702 Add a few @since entries 2012-01-06 15:36:17 +00:00
Antoine Musso
47d62862bc update message when dropping index ('index' not 'key')
Follow r99524
2011-12-12 10:48:49 +00:00
Antoine Musso
a4a025ee54 (bug 32508) clean up update.php messages
The user_options migration messages were not prefixed with '...' and
were split on several lines. This patch make the output messages more
inline with the existant ones.

Follow-up r103917


. <-- that is a patch of ink sorry.      ><OO>
2011-12-08 10:04:59 +00:00
Jeroen De Dauw
5a0e9a02f4 add since tag; please do this if you add new public methods, it avoids bugs and hassle for other people 2011-12-07 23:54:51 +00:00