aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/populateRevisionSha1.php
Commit message (Collapse)AuthorAgeFilesLines
* Remove populateRevisionSha1.phpDreamy Jazz2024-08-261-163/+0
| | | | | | | | | | | | | | | | | | | | | Why: * The populateRevisionSha1.php maintenance script last had it's update log key changed in MW 1.19 in c326cab5, and it has been added to update.php since that version. * This means that, since the script has been run via update.php since before MW 1.35, it should be possible to remove the script as all wikis will have run this script and therefore it will be skipped for all wikis (as it's in the update log). * Removing now unused maintenance scripts is important to reduce the amount of untested code in the maintenance directory and also prevents the need to update the code for migrations (e.g. using the query builders). What: * Remove the populateRevisionSha1.php maintenance script. Bug: T373238 Change-Id: Id3d46d6e0d4b8bd4aaf6d3ed01d7b759813c981a
* Use expression builder to avoid raw sql via BETWEEN operatorUmherirrender2024-04-211-5/+5
| | | | | | Replace BETWEEN with >= and <= operator Change-Id: Ic21b6f4cc11c773c967d9d4c5f20e762c2ff9629
* maintenance: Introduce getReplicaDB() and getPrimaryDB()Amir Sarabadani2024-01-181-4/+4
| | | | | | | | | | | | And start using them instead of wfGetDB(), LB/LBF connection methods or worse, $this->getDB(). $this->getDB() reuses the database object regardless of whether you're calling a replica or primary, leading to returning a replica on a primary and other way around. Bug: T330641 Change-Id: I9e2cf85ca277022284fc26b9f37db57bd12aaa81
* Convert numerous DB queries to use QueryBuildersReedy2023-10-091-12/+14
| | | | | Bug: T344971 Change-Id: Ia727b513a6bfcaa5a0b13977a6789aa879ad2f0b
* maintenance: Begin using `Maintenance::getServiceContainer()`Derick Alangi2023-09-041-3/+1
| | | | | | | | | | | Maintenance class provides a method for getting a fresh reference of the MW services container instance. Let's make use of these in maintenance scripts now that we have it. NOTE: There are still some static methods like in refreshLinks.php that makes use of services that we can't use this method for now. Change-Id: Idba744057577896fc97c9ecf4724db27542bf01c
* maintenance: Switch simple calls of Database::select to SQBAmir Sarabadani2023-07-191-2/+8
| | | | | | | Done semi-automatically via a php parser written on top of ANTLR4. Bug: T311866 Change-Id: I33f5b6703c0aa9c80c907a21c2a770e30642edd3
* maintenance: Remove PopulateArchiveRevId and DeduplicateArchiveRevIdUmherirrender2023-01-301-64/+0
| | | | | | | | | | | | | | PopulateArchiveRevId was part of the MW 1.31 updater, no longer referenced and not useful, since ar_rev_id is NOT NULL. DeduplicateArchiveRevId was part of the MW 1.32 updater, no longer referenced. Remove the backward compatibility code from UndeletePage as well Follow-Up: I84bd1d3dbe777909e30710fff5bcb655af9a4261 Follow-Up: I5ff9630a6539a587a47930847e108ac53757106f Change-Id: I7c4bb39ada74a1f06b45e8bfc05151cc8e00e9c6
* Remove or replace usages of "sanity"Reedy2021-11-191-1/+1
| | | | | Bug: T254646 Change-Id: I2b120f0b9c9e1dc1a6c216bfefa3f2463efe1001
* Replace uses of DB_MASTER with DB_PRIMARYJames D. Forrester2021-04-291-5/+5
| | | | | | Just an auto-replace from codesniffer for now. Change-Id: I5240dc9ac5929d291b0ef1c743ea2bfd3f428266
* Pass function name to database functions (maintenance scripts)Umherirrender2020-06-071-2/+2
| | | | | | Useful for logging Change-Id: I79fe037abcd74f56c935abc118d706bef0198124
* Unsuppress more phan issues (part 3)Daimona Eaytoy2019-08-311-1/+0
| | | | | | Bug: T231636 Depends-On: I78354bf5f0c831108c8f606e50c87cf6bc00d8bd Change-Id: I58e67c2b38389df874438deada4239510d21654f
* Update populateRevisionSha1.php for MCR schema changesBill Pirkle2019-07-041-51/+54
| | | | | | | | | Maintenance script populateRevisionSha1.php was using the deprecated Revision class. Instead, use the new RevisionRecord class if possible, and custom code otherwise. Bug: T217829 Change-Id: I0c22286a16d7b243306447d8948428702269a4bd
* Pass '' instead of false for the $conds parameter in select calls.daniel2018-03-021-2/+2
| | | | | | | | | Per documentation on IDatabase, $conds must be a string or an array. Passing false for conds is confusing, since it's unclear whether this should match everything or nothing. Bug: T188314 Change-Id: I8be1ac4cbdaafc41aadc2a658be8a99b754b0268
* Remove wfWaitForSlaves when using Maintenance::commitTransactionUmherirrender2018-02-261-2/+0
| | | | | | | Maintenance::commitTransaction is calling waitForReplication already. No need to wait a second time, hopefully the lags are 0 already. Change-Id: Id457ed2cdd6bfd9663665ba0cd5c4e3dd640b738
* Use ::class to resolve class names in maintenance scriptsUmherirrender2018-01-231-1/+1
| | | | | | | This helps to find renamed or misspelled classes earlier. Phan will check the class names Change-Id: I1d4567f47f93eb1436cb98558388e48d35258666
* Cast block start to int in maintenace SQLPhantom422017-12-081-2/+2
| | | | | Bug: T182209 Change-Id: Ic2dbbacdf0a77b8ac531cff8e11be0da8014e083
* Maintenance: add fatalError() methodBryan Davis2017-11-211-2/+2
| | | | | | | | Deprecate the second argument to Maintenance::error() in favor of a new Maintenance::fatalError() method. This is intended to make it easier to review flow control in maintenance scripts. Change-Id: I75699008638f7e99b11210c7bb9e2e131fca7c9e
* Finish migration to Maintenance::getBatchSize()Max Semenik2017-11-071-4/+5
| | | | Change-Id: I02d89f71d820e4d00a39e86a30397b614bbdb432
* Replace selectFields() methods with getQueryInfo()Brad Jorsch2017-10-301-6/+10
| | | | | | | | | | | | | | Several classes have a "selectFields()" static method to tell callers which fields to select from the database. With the recent comment table change and the upcoming actor table change, this pattern has become too simplistic as a SELECT will need to join several tables to be able to retrieve all the needed fields. Thus, we deprecate the selectFields() methods in favor of getQueryInfo() methods that return tables and join conditions in addition to the fields. Change-Id: Idcfd15568489d9f03a7ba4460e96610d33bc4089
* Replace more uses of "SELECT *"Brad Jorsch2017-10-131-5/+5
| | | | | | | | | With the introduction of CommentStore, selects from various table require certain joins or column aliases for proper operation. The upcoming actor table change, and the suggested title table change, will add more such requirements. Change-Id: Ic8213bff74b8350b15cd271d0ef252e63e7e79bd
* maintenance: Replace implicit Bugzilla bug numbers with Phab onesJames D. Forrester2017-02-211-4/+4
| | | | | | | | | It's unreasonable to expect newbies to know that "bug 12345" means "Task T14345" except where it doesn't, so let's just standardise on the real numbers. This includes renaming fixBug20757.php to fixT22757.php for similar consistency. Change-Id: If81a590d658fbd82c20c54ac47dfdc8856745ca3
* Convert all array() syntax to []Kunal Mehta2016-02-171-6/+6
| | | | | | | | | | Per wikitech-l consensus: https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html Notes: * Disabled CallTimePassByReference due to false positives (T127163) Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
* Use addDescription() instead of accessing mDescription directlyMax Semenik2016-01-301-1/+1
| | | | Change-Id: I0e2aa83024b8abf5298cfea4b21bf45722ad3103
* Clean up transactions in maintenance scriptsAaron Schulz2015-12-301-6/+6
| | | | | | | | | | | | | | | Add transaction methods to complement getDB(). This makes it easy to grep for direct begin()/commit() calls to IDatabase by having script use their own wrapper. Maintenance scripts are one of the few places that can (and need to) use begin/commit instead of the start/end atomic methods. Eventually, there should be almost no direct callers and those methods can be made stricter about throwing errors on nested calls. Change-Id: Ibbfc7a77c0d2a55f7fc2261087f6c3a19061e0aa
* Updated some try-catch statements: MWException -> ExceptionAaron Schulz2015-01-091-2/+2
| | | | Change-Id: I76601a86e30f4984e3b1a8c8ec5ef5a0f652433a
* Update formatting in maintenance/ (3/4)Siebrand Mazeland2014-04-231-0/+11
| | | | Change-Id: I4390c4ea12a6a626b0e6817b6446635116ca9fe3
* Pass phpcs-strict on maintenance/ (3/8)Siebrand Mazeland2014-04-221-1/+2
| | | | Change-Id: I453ecc474139c7a5f1d0d20306ad28c2cee80ec9
* Fixed some @params documentation (maintenance)umherirrender2014-04-171-9/+9
| | | | | | | | | 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: I727deec35a712de0f0c676cc87dfa661f1ee965b
* phpcs: More require/include is not a functionTimo Tijhof2013-05-211-1/+1
| | | | | | | | | | | | | Follows-up I1343872de7, Ia533aedf63 and I2df2f80b81. Also updated usage in text in documentation and the installer LocalSettingsGenerator. Most of them were handled by this regex: - find: (require|include|require_once|include_once)\s*\(\s*(.+?)\s*\)\s*;$ - replace: $1 $2; Change-Id: I6b38aad9a5149c9c43ce18bd8edbab14b8ce43fa
* phpcs: Fix WhiteSpace.LanguageConstructSpacing warningsTimo Tijhof2013-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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
* else if -> elseifumherirrender2013-04-171-3/+3
| | | | | | | Also fixed some spacing while at it Added some braces for one line statements Change-Id: Iebfa2b17091509daabc76248121c7763e2295d20
* (bug 38110) provide a way to separate out schema changesMarkAHershberger2012-11-211-0/+3
| | | | | | | | | | | | | | | | | | | | 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
* merged masterdaniel2012-08-291-1/+1
| | | | Change-Id: Ib2b879c4daa17401eeeb50767c0e5a54254855c3
* Revert "merged master"Daniel Kinzler2012-08-291-1/+1
| | | This reverts commit 67bfdc7a68940d901e585eadd984a2074bf0216a
* merged masterdaniel2012-08-291-1/+1
| | | | Change-Id: Ib2b879c4daa17401eeeb50767c0e5a54254855c3
* merging latest masterdaniel2012-08-201-0/+7
| | | | Change-Id: I36b7f2f63ab8c08f8412d521dc68ea45c8b67711
* getting rid of getRawText()daniel2012-06-081-5/+5
|
* Big oops - merged to wrong branch.awjrichards2012-06-051-5/+9
| | | | | Revert "Revert to arbitrarily old point before initial remote branch creation to help clean up" This reverts commit ee0d3d330f76b97c451c168dc9b052ee84609b5b
* Revert to arbitrarily old point before initial remote branch creation to ↵awjrichards2012-06-021-9/+5
| | | | | | help clean up Change-Id: I41a3d1e55d3ea9dffa42451237fe065f9334361d
* Handle more ES exceptions when getting text.Aaron Schulz2012-05-291-5/+9
| | | | Change-Id: I795dce37bcf4a24d5922d2d5166bf27ba9b77607
* Merge "Work around annoying Revision::newFromArchiveRow exception."Brion VIBBER2012-05-241-1/+5
|\
| * Work around annoying Revision::newFromArchiveRow exception.Aaron Schulz2012-05-231-3/+7
| | | | | | | | Change-Id: Ib5cfae54b12fd2fee5120d7dbae7a1e2b99b0181
* | Skip legacy archives rows that already have the sha1 filled.Aaron Schulz2012-05-231-3/+4
|/ | | | Change-Id: I070413a736211017022c7ae36a9efab3aa0e1fe1
* Minor followup to r111795, make doSha1LegacyUpdates return it's count value ↵Sam Reed2012-03-061-2/+17
| | | | | | | | | so it can be added to the count of archive rows Don't return true in doSha1Updates(), return 0 if table is empty Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/113169
* More __METHOD__ in our madnessSam Reed2012-02-241-6/+6
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/112339
* r111795: Split out upgradeLegacyArchiveRow() function and added NS/title to ↵Aaron Schulz2012-02-201-1/+26
| | | | | | | condition. The $idCol var was misleading as obviously ar_timestamp is not unique. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/111920
* r111795: update line to remove bogus $db argumentAaron Schulz2012-02-191-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/111881
* (bug 34373) - 'populateRevisionSha1.php misses archive rows, whose text is ↵Aaron Schulz2012-02-171-20/+53
| | | | | | | stored directly in the archive table (not text table)' Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/111795
* Documentations!Sam Reed2012-02-141-0/+4
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/111445
* Reinstated r94289 et all - rev_sha1/ar_sha1 field for bug 21860Aaron Schulz2011-10-271-0/+108
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/101021