Mwalker has submitted this change and it was merged.
Change subject: Initial sqlite compatibility
......................................................................
Initial sqlite compatibility
This begins to make us compatible with the default WMF continuous integration.
We don't have to support any past migrations.
Also, kill erroneous duplicate schema update function
Change-Id: Id5095b95e107ec86c2a37fa2e8658b3c5dd9b126
---
M CentralNotice.php
M patches/CNDatabasePatcher.php
2 files changed, 8 insertions(+), 89 deletions(-)
Approvals:
Mwalker: Looks good to me, approved
jenkins-bot: Verified
diff --git a/CentralNotice.php b/CentralNotice.php
index 4b4c9ac..3061512 100644
--- a/CentralNotice.php
+++ b/CentralNotice.php
@@ -267,7 +267,6 @@
$wgAPIListModules[ 'centralnoticelogs' ] = 'ApiCentralNoticeLogs';
// Register hooks
- $wgHooks[ 'LoadExtensionSchemaUpdates' ][ ] = 'efCentralNoticeSchema';
$wgHooks[ 'UnitTestsList' ][ ] = 'efCentralNoticeUnitTests';
// If CentralNotice banners should be shown on this wiki, load the
components we need for
@@ -344,93 +343,6 @@
return true;
};
-
-/**
- * LoadExtensionSchemaUpdates hook handler
- * This function makes sure that the database schema is up to date.
- *
- * @param $updater DatabaseUpdater|null
- * @return bool
- */
-function efCentralNoticeSchema( $updater = null ) {
- $base = __DIR__;
-
- if ( $updater->getDB()->getType() == 'mysql' ) {
- $updater->addExtensionUpdate(
- array(
- 'addTable', 'cn_notices',
- $base . '/CentralNotice.sql', true
- )
- );
- $updater->addExtensionUpdate(
- array(
- 'addField', 'cn_notices', 'not_preferred',
- $base . '/patches/patch-notice_preferred.sql',
true
- )
- );
- $updater->addExtensionUpdate(
- array(
- 'addTable', 'cn_notice_languages',
- $base . '/patches/patch-notice_languages.sql',
true
- )
- );
- $updater->addExtensionUpdate(
- array(
- 'addField', 'cn_templates', 'tmp_display_anon',
- $base . '/patches/patch-template_settings.sql',
true
- )
- );
- $updater->addExtensionUpdate(
- array(
- 'addField', 'cn_templates', 'tmp_fundraising',
- $base .
'/patches/patch-template_fundraising.sql', true
- )
- );
- $updater->addExtensionUpdate(
- array(
- 'addTable', 'cn_notice_countries',
- $base . '/patches/patch-notice_countries.sql',
true
- )
- );
- $updater->addExtensionUpdate(
- array(
- 'addTable', 'cn_notice_projects',
- $base . '/patches/patch-notice_projects.sql',
true
- )
- );
- $updater->addExtensionUpdate(
- array(
- 'addTable', 'cn_notice_log',
- $base . '/patches/patch-notice_log.sql', true
- )
- );
- $updater->addExtensionUpdate(
- array(
- 'addTable', 'cn_template_log',
- $base . '/patches/patch-template_log.sql', true
- )
- );
- $updater->addExtensionUpdate(
- array(
- 'addField', 'cn_templates', 'tmp_autolink',
- $base . '/patches/patch-template_autolink.sql',
true
- )
- );
- $updater->addExtensionUpdate(
- array(
- 'addField', 'cn_template_log',
'tmplog_begin_prioritylangs',
- $base . '/patches/patch-prioritylangs.sql', true
- )
- );
- $updater->addExtensionUpdate(
- array(
- 'addField', 'cn_notices', 'not_buckets',
- $base . '/patches/patch-bucketing.sql', true
- )
- );
- }
- return true;
-}
/**
* BeforePageDisplay hook handler
@@ -634,4 +546,4 @@
return true;
}
-$wgHooks[ 'LoadExtensionSchemaUpdates' ][ ] =
'CNDatabasePatcher::applyUpdates';
\ No newline at end of file
+$wgHooks[ 'LoadExtensionSchemaUpdates' ][ ] =
'CNDatabasePatcher::applyUpdates';
diff --git a/patches/CNDatabasePatcher.php b/patches/CNDatabasePatcher.php
index 25a9c88..99ea813 100644
--- a/patches/CNDatabasePatcher.php
+++ b/patches/CNDatabasePatcher.php
@@ -99,6 +99,13 @@
$base .
'/patch-centralnotice-2_3.sql', true
)
);
+ } elseif ( $updater->getDB()->getType() == 'sqlite' ) {
+ $updater->addExtensionUpdate(
+ array(
+ 'addTable', 'cn_notices',
+ $base . '/CentralNotice.sql', true
+ )
+ );
}
return true;
}
--
To view, visit https://gerrit.wikimedia.org/r/55793
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id5095b95e107ec86c2a37fa2e8658b3c5dd9b126
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/CentralNotice
Gerrit-Branch: master
Gerrit-Owner: Adamw <[email protected]>
Gerrit-Reviewer: Mwalker <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits