updater: Improve updater for table echo_unread_wikis

Follow-Up: I227801f850bb9d60488b5dd8b1f84c4c22708f5d
Change-Id: Idcc577a86045ffb2ea3f11d990b324ce6ab91cef
This commit is contained in:
Umherirrender 2022-04-13 21:22:05 +02:00
parent 3e8c531c78
commit b442f100cd

View file

@ -193,16 +193,6 @@ class EchoHooks implements RecentChange_saveHook {
$updater->dropExtensionIndex( 'echo_notification', 'echo_notification_user_hash_timestamp',
"$dir/db_patches/patch-drop-user-hash-timestamp-index.sql" );
// XXX: When is this table from? Gerrit claims b85f978 in 1.27 but this is new?
global $wgWikimediaJenkinsCI;
if ( !empty( $wgWikimediaJenkinsCI ) ) {
$updater->addExtensionTable( 'echo_unread_wikis', "$dir/db_patches/echo_unread_wikis.sql" );
}
// 1.34 (backported)
$updater->modifyExtensionField( 'echo_unread_wikis', 'euw_wiki',
"$dir/db_patches/patch-increase-varchar-echo_unread_wikis-euw_wiki.sql" );
// 1.35
$updater->addExtensionTable( 'echo_push_provider', "$dir/db_patches/echo_push_provider.sql" );
@ -211,6 +201,20 @@ class EchoHooks implements RecentChange_saveHook {
// 1.35 - order of tables needed for declaring references
$updater->addExtensionTable( 'echo_push_subscription', "$dir/db_patches/echo_push_subscription.sql" );
global $wgEchoSharedTrackingCluster, $wgEchoSharedTrackingDB;
// Following tables should only be created if both cluster and database are false.
// Otherwise they are not created in the place they are accesses, because
// DatabaseUpdater does not support other databases other than main wiki schema.
if ( $wgEchoSharedTrackingCluster === false && $wgEchoSharedTrackingDB === false ) {
$updater->addExtensionTable( 'echo_unread_wikis', "$dir/db_patches/echo_unread_wikis.sql" );
// 1.34 (backported) - not for sqlite, the used data type supports the new length
if ( $updater->getDB()->getType() === 'mysql' ) {
$updater->modifyExtensionField( 'echo_unread_wikis', 'euw_wiki',
"$dir/db_patches/patch-increase-varchar-echo_unread_wikis-euw_wiki.sql" );
}
}
}
/**