Aaron Schulz has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332653 )

Change subject: Avoid DB error in update.php for sqlite
......................................................................

Avoid DB error in update.php for sqlite

Change-Id: I60b3e2fc9bdf4cd8e27ca11afeab96f77675a983
---
M backend/schema/ConfirmAccountUpdater.hooks.php
1 file changed, 7 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ConfirmAccount 
refs/changes/53/332653/1

diff --git a/backend/schema/ConfirmAccountUpdater.hooks.php 
b/backend/schema/ConfirmAccountUpdater.hooks.php
index 2afca57..e2b7c99 100755
--- a/backend/schema/ConfirmAccountUpdater.hooks.php
+++ b/backend/schema/ConfirmAccountUpdater.hooks.php
@@ -10,7 +10,8 @@
         */
        public static function addSchemaUpdates( DatabaseUpdater $updater ) {
                $base = __DIR__;
-               if ( $updater->getDB()->getType() == 'mysql' || 
$updater->getDB()->getType() == 'sqlite' ) {
+               $type = $updater->getDB()->getType();
+               if ( $type === 'mysql' || $type === 'sqlite' ) {
                        $base = "$base/mysql";
 
                        $updater->addExtensionTable( 'account_requests', 
"$base/ConfirmAccount.sql" );
@@ -19,15 +20,17 @@
                        );
                        $updater->addExtensionTable( 'account_credentials', 
"$base/patch-account_credentials.sql" );
                        $updater->addExtensionField( 'account_requests', 
'acr_areas', "$base/patch-acr_areas.sql" );
+                       if ( $type !== 'sqlite' ) {
                        $updater->modifyExtensionField(
-                               'account_requests', 'acr_email', 
"$base/patch-acr_email-varchar.sql"
-                       );
+                                       'account_requests', 'acr_email', 
"$base/patch-acr_email-varchar.sql"
+                               );
+                       }
                        $updater->addExtensionIndex( 'account_requests', 
'acr_email', "$base/patch-email-index.sql" );
                        $updater->addExtensionField( 'account_requests', 
'acr_agent', "$base/patch-acr_agent.sql" );
                        $updater->dropExtensionIndex(
                                'account_requests', 'acr_deleted_reg', 
"$base/patch-drop-acr_deleted_reg-index.sql"
                        );
-               } elseif ( $updater->getDB()->getType() == 'postgres' ) {
+               } elseif ( $type === 'postgres' ) {
                        $base = "$base/postgres";
 
                        $updater->addExtensionUpdate(

-- 
To view, visit https://gerrit.wikimedia.org/r/332653
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I60b3e2fc9bdf4cd8e27ca11afeab96f77675a983
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ConfirmAccount
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <asch...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to