Merge "Wire migration scripts to SchemaHooks"

This commit is contained in:
jenkins-bot 2024-10-16 23:33:51 +00:00 committed by Gerrit Code Review
commit 724f836b1b
4 changed files with 17 additions and 0 deletions

View file

@ -12,6 +12,10 @@
"requires": {
"MediaWiki": ">= 1.43"
},
"AutoloadClasses": {
"MediaWiki\\Linter\\Maintenance\\MigrateNamespace": "maintenance/migrateNamespace.php",
"MediaWiki\\Linter\\Maintenance\\MigrateTagTemplate": "maintenance/migrateTagTemplate.php"
},
"AutoloadNamespaces": {
"MediaWiki\\Linter\\": "includes/"
},

View file

@ -22,6 +22,8 @@ namespace MediaWiki\Linter;
use MediaWiki\Installer\DatabaseUpdater;
use MediaWiki\Installer\Hook\LoadExtensionSchemaUpdatesHook;
use MediaWiki\Linter\Maintenance\MigrateNamespace;
use MediaWiki\Linter\Maintenance\MigrateTagTemplate;
class SchemaHooks implements LoadExtensionSchemaUpdatesHook {
/**
@ -45,5 +47,8 @@ class SchemaHooks implements LoadExtensionSchemaUpdatesHook {
$updater->modifyExtensionField( 'linter', 'linter_params',
"{$dir}/sql/{$dbType}/patch-linter-fix-params-null-definition.sql"
);
// 1.43
$updater->addPostDatabaseUpdateMaintenance( MigrateNamespace::class );
$updater->addPostDatabaseUpdateMaintenance( MigrateTagTemplate::class );
}
}

View file

@ -1,5 +1,9 @@
<?php
namespace MediaWiki\Linter\Maintenance;
use LoggedUpdateMaintenance;
/**
* Maintenance script that migrates the page table page_namespace field values
* to the linter table linter_namespace field to improve linter search performance.

View file

@ -1,5 +1,9 @@
<?php
namespace MediaWiki\Linter\Maintenance;
use LoggedUpdateMaintenance;
/**
* Maintenance script that migrates the linter_params field value to the new tag and template fields
* Note: The schema migration "patch-linter-add-template-tag-fields.json" is expected to have been done.