aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/migrateBlocks.php
Commit message (Collapse)AuthorAgeFilesLines
* add `use MediaWiki\Maintenance\Maintenance` to some maintenance classesNovem Linguae2024-12-041-0/+1
| | | | | | | | | | | | | F–P. Still need to do P–Z. there's a couple spots where I added `use MediaWiki\Maintenance\LoggedUpdateMaintenance;` or similar instead. some of the existing "use" blocks were in weird spots (e.g. above the copyright docblock, or too far down). i didn't move those because they are out of scope for this patch. Change-Id: I5b6a8f3eae5be85d67bccfcce31c0c2027850f45
* Exclude boilerplate maintenance code from code coverage reportsDreamy Jazz2024-08-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * Maintenance scripts in core have bolierplate code that is added before and after the class to allow directly running the maintenance script. * Running the maintenance script directly has been deprecated since 1.40, so this boilerplate code is only to support a now deprecated method of running maintenance scripts. * This code cannot also be marked as covered, due to PHPUnit not recognising code coverage for files. * Therefore, it is best to ignore this boilerplate code in code coverage reports as it cannot be marked as covered and also is for deprecated code. What: * Wrap the boilerplate code (requiring Maintenance.php and then later defining the maintenance script class and running if the maintenance script was called directly) with @codeCoverageIgnore comments. * Some files use a different boilerplate code, however, these should also be marked as ignored for coverage for the same reason that coverage is not properly reported for files. Bug: T371167 Change-Id: I32f5c6362dfb354149a48ce9c28da9a7fc494f7c
* rdbms: Warn about queries that don't provide the callerBartosz Dziewoński2024-05-311-2/+5
| | | | Change-Id: Ib02dac0c607fc9931e1384a9cd7e989db683a4ff
* block: Migrate to the new block schema on non-WMF wikisTim Starling2024-05-091-0/+4
| | | | | | | | | | | | Migrate from ipblocks to block/block_target and drop the ipblocks table. Update tests. In PostgresUpdater, change some schema update functions to skip field updates if the table doesn't exist, by analogy with DatabaseUpdater::modifyField. Bug: T346293 Change-Id: Icf91b35f7f729cead7c800429653eb30731762a1
* Drop old class_aliases for before MW 1.39 that were missedJames D. Forrester2024-03-201-0/+1
| | | | | | | The RandomPage alias was dropped in an earlier commit, so group the release note entry in with these. Change-Id: I207d7463ced1a1bb8b8ac749eba175fc0037a217
* migrateBlocks.php: Fix infinite loopTim Starling2024-03-131-1/+1
| | | | | | | Don't go into an infinite loop if the batch contains only rows that are skipped due to ipb_user === 0. Change-Id: I2b8398bcc78267e80313ecc6e64033805d83fdef
* migrateBlocks.php: Skip existing IDsTim Starling2024-03-111-2/+9
| | | | | | | | | | | When copying blocks from ipblocks to the new block table, skip rows for which the relevant ID already exists in the block table. In write-both mode, it is expected that some blocks will have already been copied. This also allows the script to be run multiple times on a wiki, so that it can be used to clean up the current situation in production. Bug: T355034 Change-Id: I54e65adef685bfc7d4f63853cd50ca0f55e2ecdb
* MigrateBlocks: maintenance script for migrating to multiblocks schemaMusikAnimal2024-01-111-0/+164
The old ipblocks table is left touched. The data is normalized to match the new schema, including resolving any data integrity issues with ipb_parent_block_id (T282890). Data is not validated as it is copied. Existing logic could be used from DatabaseBlockStore, but it performs other non-idempotent actions, and would probably slow down the script. The default batch size is 500 instead of the typical 1000 because two INSERTs are performed for each ipblock. Bug: T350361 Bug: T282890 Change-Id: I526bb9b8febc5c1cb6a56b9a1044dedcf99c2224