Run pagelinks migration for third parties too
Production is read new almost everywhere, mediawiki core should reflect that as well. Bug: T299947 Change-Id: I8f05c4d7026394205bfc54b68dc725392852ae2a
This commit is contained in:
parent
7edec968c3
commit
cf77897613
9 changed files with 45 additions and 6 deletions
|
|
@ -29,6 +29,9 @@ For notes on 1.42.x and older releases, see HISTORY.
|
|||
|
||||
==== Changed configuration ====
|
||||
|
||||
* wgPageLinksSchemaMigrationStage – (T299947) This temporary setting, which
|
||||
controls the database schema migration for the page links table, is now set
|
||||
by default to write to both old and new data and read from the new data.
|
||||
* …
|
||||
|
||||
==== Removed configuration ====
|
||||
|
|
|
|||
|
|
@ -1998,15 +1998,18 @@ config-schema:
|
|||
- 1.39: Default has changed to SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_OLD
|
||||
and support for SCHEMA_COMPAT_OLD is dropped.
|
||||
PageLinksSchemaMigrationStage:
|
||||
default: 3
|
||||
default: 769
|
||||
type: integer
|
||||
description: |-
|
||||
Pagelinks table schema migration stage, for normalizing pl_namespace and pl_title fields.
|
||||
Use the SCHEMA_COMPAT_XXX flags. Supported values:
|
||||
- SCHEMA_COMPAT_WRITE_OLD | SCHEMA_COMPAT_READ_OLD
|
||||
- SCHEMA_COMPAT_WRITE_OLD | SCHEMA_COMPAT_READ_OLD (SCHEMA_COMPAT_OLD)
|
||||
- SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_OLD
|
||||
- SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_NEW
|
||||
- SCHEMA_COMPAT_WRITE_NEW | SCHEMA_COMPAT_READ_NEW (SCHEMA_COMPAT_NEW)
|
||||
History:
|
||||
- 1.41: Added
|
||||
- 1.43: Default has changed to SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_NEW.
|
||||
ExternalLinksDomainGaps:
|
||||
default: { }
|
||||
type: object
|
||||
|
|
|
|||
|
|
@ -3286,14 +3286,17 @@ class MainConfigSchema {
|
|||
*
|
||||
* Use the SCHEMA_COMPAT_XXX flags. Supported values:
|
||||
*
|
||||
* - SCHEMA_COMPAT_WRITE_OLD | SCHEMA_COMPAT_READ_OLD
|
||||
* - SCHEMA_COMPAT_WRITE_OLD | SCHEMA_COMPAT_READ_OLD (SCHEMA_COMPAT_OLD)
|
||||
* - SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_OLD
|
||||
* - SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_NEW
|
||||
* - SCHEMA_COMPAT_WRITE_NEW | SCHEMA_COMPAT_READ_NEW (SCHEMA_COMPAT_NEW)
|
||||
*
|
||||
* History:
|
||||
* - 1.41: Added
|
||||
* - 1.43: Default has changed to SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_NEW.
|
||||
*/
|
||||
public const PageLinksSchemaMigrationStage = [
|
||||
'default' => SCHEMA_COMPAT_WRITE_OLD | SCHEMA_COMPAT_READ_OLD,
|
||||
'default' => SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_NEW,
|
||||
'type' => 'integer',
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -392,7 +392,7 @@ return [
|
|||
'VirtualDomainsMapping' => [
|
||||
],
|
||||
'TemplateLinksSchemaMigrationStage' => 768,
|
||||
'PageLinksSchemaMigrationStage' => 3,
|
||||
'PageLinksSchemaMigrationStage' => 769,
|
||||
'ExternalLinksDomainGaps' => [
|
||||
],
|
||||
'ContentHandlers' => [
|
||||
|
|
|
|||
|
|
@ -1272,6 +1272,27 @@ abstract class DatabaseUpdater {
|
|||
$this->output( "done.\n" );
|
||||
}
|
||||
|
||||
protected function migratePagelinks() {
|
||||
if ( $this->updateRowExists( MigrateLinksTable::class . 'pagelinks' ) ) {
|
||||
$this->output( "...pagelinks table has already been migrated.\n" );
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* @var MigrateLinksTable $task
|
||||
*/
|
||||
$task = $this->maintenance->runChild(
|
||||
MigrateLinksTable::class, 'migrateLinksTable.php'
|
||||
);
|
||||
'@phan-var MigrateLinksTable $task';
|
||||
$task->loadParamsAndArgs( MigrateLinksTable::class, [
|
||||
'force' => true,
|
||||
'table' => 'pagelinks'
|
||||
] );
|
||||
$this->output( "Running migrateLinksTable.php on pagelinks...\n" );
|
||||
$task->execute();
|
||||
$this->output( "done.\n" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Only run a function if a table does not exist
|
||||
*
|
||||
|
|
|
|||
|
|
@ -173,6 +173,9 @@ class MysqlUpdater extends DatabaseUpdater {
|
|||
[ 'runMaintenance', PopulateUserIsTemp::class, 'maintenance/populateUserIsTemp.php' ],
|
||||
[ 'dropIndex', 'sites', 'site_type', 'patch-sites-drop_indexes.sql' ],
|
||||
[ 'dropIndex', 'iwlinks', 'iwl_prefix_from_title', 'patch-iwlinks-drop-iwl_prefix_from_title.sql' ],
|
||||
|
||||
// 1.43
|
||||
[ 'migratePagelinks' ],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -473,6 +473,9 @@ class PostgresUpdater extends DatabaseUpdater {
|
|||
[ 'runMaintenance', PopulateUserIsTemp::class, 'maintenance/populateUserIsTemp.php' ],
|
||||
[ 'dropIndex', 'sites', 'site_type', 'patch-sites-drop_indexes.sql' ],
|
||||
[ 'dropIndex', 'iwlinks', 'iwl_prefix_from_title', 'patch-iwlinks-drop-iwl_prefix_from_title.sql' ],
|
||||
|
||||
// 1.43
|
||||
[ 'migratePagelinks' ],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -155,6 +155,9 @@ class SqliteUpdater extends DatabaseUpdater {
|
|||
[ 'runMaintenance', PopulateUserIsTemp::class, 'maintenance/populateUserIsTemp.php' ],
|
||||
[ 'dropIndex', 'sites', 'site_type', 'patch-sites-drop_indexes.sql' ],
|
||||
[ 'dropIndex', 'iwlinks', 'iwl_prefix_from_title', 'patch-iwlinks-drop-iwl_prefix_from_title.sql' ],
|
||||
|
||||
// 1.43
|
||||
[ 'migratePagelinks' ],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -117,9 +117,9 @@ class ApiQueryBasicTest extends ApiQueryTestBase {
|
|||
private static $alllinks = [
|
||||
[ 'list' => 'alllinks', 'alprefix' => 'AQBT-' ],
|
||||
[ 'alllinks' => [
|
||||
[ 'ns' => NS_MAIN, 'title' => 'AQBT-Links' ],
|
||||
[ 'ns' => NS_MAIN, 'title' => 'AQBT-All' ],
|
||||
[ 'ns' => NS_MAIN, 'title' => 'AQBT-Categories' ],
|
||||
[ 'ns' => NS_MAIN, 'title' => 'AQBT-Links' ],
|
||||
[ 'ns' => NS_MAIN, 'title' => 'AQBT-Templates' ],
|
||||
] ]
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in a new issue