mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Linter
synced 2024-11-27 17:20:12 +00:00
Wire migration scripts to SchemaHooks
Add MigrateNamespace and MigrateTagTemplate as post database update maintenance operations. Bug: T367207 Change-Id: I7676f9ce4bef59febc463d897cb26d47347a3968
This commit is contained in:
parent
9d5c586377
commit
165354ab91
|
@ -12,6 +12,10 @@
|
||||||
"requires": {
|
"requires": {
|
||||||
"MediaWiki": ">= 1.43"
|
"MediaWiki": ">= 1.43"
|
||||||
},
|
},
|
||||||
|
"AutoloadClasses": {
|
||||||
|
"MediaWiki\\Linter\\Maintenance\\MigrateNamespace": "maintenance/migrateNamespace.php",
|
||||||
|
"MediaWiki\\Linter\\Maintenance\\MigrateTagTemplate": "maintenance/migrateTagTemplate.php"
|
||||||
|
},
|
||||||
"AutoloadNamespaces": {
|
"AutoloadNamespaces": {
|
||||||
"MediaWiki\\Linter\\": "includes/"
|
"MediaWiki\\Linter\\": "includes/"
|
||||||
},
|
},
|
||||||
|
|
|
@ -22,6 +22,8 @@ namespace MediaWiki\Linter;
|
||||||
|
|
||||||
use MediaWiki\Installer\DatabaseUpdater;
|
use MediaWiki\Installer\DatabaseUpdater;
|
||||||
use MediaWiki\Installer\Hook\LoadExtensionSchemaUpdatesHook;
|
use MediaWiki\Installer\Hook\LoadExtensionSchemaUpdatesHook;
|
||||||
|
use MediaWiki\Linter\Maintenance\MigrateNamespace;
|
||||||
|
use MediaWiki\Linter\Maintenance\MigrateTagTemplate;
|
||||||
|
|
||||||
class SchemaHooks implements LoadExtensionSchemaUpdatesHook {
|
class SchemaHooks implements LoadExtensionSchemaUpdatesHook {
|
||||||
/**
|
/**
|
||||||
|
@ -45,5 +47,8 @@ class SchemaHooks implements LoadExtensionSchemaUpdatesHook {
|
||||||
$updater->modifyExtensionField( 'linter', 'linter_params',
|
$updater->modifyExtensionField( 'linter', 'linter_params',
|
||||||
"{$dir}/sql/{$dbType}/patch-linter-fix-params-null-definition.sql"
|
"{$dir}/sql/{$dbType}/patch-linter-fix-params-null-definition.sql"
|
||||||
);
|
);
|
||||||
|
// 1.43
|
||||||
|
$updater->addPostDatabaseUpdateMaintenance( MigrateNamespace::class );
|
||||||
|
$updater->addPostDatabaseUpdateMaintenance( MigrateTagTemplate::class );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace MediaWiki\Linter\Maintenance;
|
||||||
|
|
||||||
|
use LoggedUpdateMaintenance;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maintenance script that migrates the page table page_namespace field values
|
* Maintenance script that migrates the page table page_namespace field values
|
||||||
* to the linter table linter_namespace field to improve linter search performance.
|
* to the linter table linter_namespace field to improve linter search performance.
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace MediaWiki\Linter\Maintenance;
|
||||||
|
|
||||||
|
use LoggedUpdateMaintenance;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maintenance script that migrates the linter_params field value to the new tag and template fields
|
* 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.
|
* Note: The schema migration "patch-linter-add-template-tag-fields.json" is expected to have been done.
|
||||||
|
|
Loading…
Reference in a new issue