diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-03-14 16:28:56 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-06-03 11:17:21 +0200 |
commit | 35550e8d9a7239c66457fc1533462fd5949d9d2d (patch) | |
tree | 911b26c2e8a0175fff18cc557481cd4f122f469f /tests | |
parent | 5243562f45716920b1015a431365dc3fc0bbaf45 (diff) | |
download | nextcloud-server-35550e8d9a7239c66457fc1533462fd5949d9d2d.tar.gz nextcloud-server-35550e8d9a7239c66457fc1533462fd5949d9d2d.zip |
Fix migrator for postgres
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/db/migrator.php | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/tests/lib/db/migrator.php b/tests/lib/db/migrator.php index 258d6451847..88f6d7dcc63 100644 --- a/tests/lib/db/migrator.php +++ b/tests/lib/db/migrator.php @@ -20,25 +20,21 @@ class Migrator extends \PHPUnit_Framework_TestCase { private $tableName; - private $fullTableName; - public function setUp() { $this->tableName = 'test_' . uniqid(); $this->connection = \OC_DB::getConnection(); if ($this->connection->getDriver() instanceof \Doctrine\DBAL\Driver\PDOSqlite\Driver) { $this->markTestSkipped('Migration tests dont function on sqlite since sqlite doesnt give an error on existing duplicate data'); - } else { - $this->fullTableName = $this->connection->getDatabase() . '.' . $this->tableName; } } public function tearDown() { - $this->connection->exec('DROP TABLE ' . $this->fullTableName); + $this->connection->exec('DROP TABLE ' . $this->tableName); } private function getInitialSchema() { $schema = new Schema(array(), array(), $this->getSchemaConfig()); - $table = $schema->createTable($this->fullTableName); + $table = $schema->createTable($this->tableName); $table->addColumn('id', 'integer'); $table->addColumn('name', 'string'); $table->addIndex(array('id'), $this->tableName . '_id'); @@ -47,7 +43,7 @@ class Migrator extends \PHPUnit_Framework_TestCase { private function getNewSchema() { $schema = new Schema(array(), array(), $this->getSchemaConfig()); - $table = $schema->createTable($this->fullTableName); + $table = $schema->createTable($this->tableName); $table->addColumn('id', 'integer'); $table->addColumn('name', 'string'); $table->addUniqueIndex(array('id'), $this->tableName . '_id'); |