Adamw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/133890

Change subject: Sloppy fix for mysql vs sqlite syntax
......................................................................

Sloppy fix for mysql vs sqlite syntax

Change-Id: I6c770c6becd3e24d8d0b653ceab0f912baca7653
---
M tests/phpunit/persistence/internal/db/DBPersistenceManagerTest.php
1 file changed, 6 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Campaigns 
refs/changes/90/133890/1

diff --git a/tests/phpunit/persistence/internal/db/DBPersistenceManagerTest.php 
b/tests/phpunit/persistence/internal/db/DBPersistenceManagerTest.php
index fd9e647..1a1ae91 100644
--- a/tests/phpunit/persistence/internal/db/DBPersistenceManagerTest.php
+++ b/tests/phpunit/persistence/internal/db/DBPersistenceManagerTest.php
@@ -29,11 +29,12 @@
                // Create a table to use for test
                $db = $this->db;
 
-               $db->query( 'CREATE TEMPORARY TABLE IF NOT EXISTS '
-                       . $db->tableName( $this->table ) . ' (' .
-                       'id int unsigned NOT NULL PRIMARY KEY auto_increment,' .
-                       'field1 varchar(255) UNIQUE,' .
-                       'field2 varchar(255) );',
+               $autoincrement = ($db->getType() === 'sqlite' ? 'autoincrement' 
: 'auto_increment');
+               $db->query( "CREATE TEMPORARY TABLE IF NOT EXISTS
+                       {$db->tableName( $this->table )} (
+                       id int unsigned NOT NULL PRIMARY KEY {$autoincrement},
+                       field1 varchar(255) UNIQUE,
+                       field2 varchar(255) )",
                        __METHOD__ );
 
                // TestHelper provides some convenience functionality that we 
use

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6c770c6becd3e24d8d0b653ceab0f912baca7653
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Campaigns
Gerrit-Branch: wip/editorcampaigns
Gerrit-Owner: Adamw <awi...@wikimedia.org>

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

Reply via email to