Skip to content
Snippets Groups Projects
Commit b72a3e5b authored by Thomas Müller's avatar Thomas Müller
Browse files

Merge pull request #9837 from owncloud/ignore-non-oc-tables-master

Adding test which breaks because bit and/or enum datatypes are used
parents fa333c02 7d60f7a2
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,10 @@ class MySQLMigrator extends Migrator {
* @return \Doctrine\DBAL\Schema\SchemaDiff
*/
protected function getDiff(Schema $targetSchema, \Doctrine\DBAL\Connection $connection) {
$platform = $connection->getDatabasePlatform();
$platform->registerDoctrineTypeMapping('enum', 'string');
$platform->registerDoctrineTypeMapping('bit', 'string');
$schemaDiff = parent::getDiff($targetSchema, $connection);
// identifiers need to be quoted for mysql
......
<?php
/**
* Copyright (c) 2014 Thomas Müller <deepdiver@owncloud.com>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
class TestMigration extends \PHPUnit_Framework_TestCase {
/** @var \Doctrine\DBAL\Connection */
private $connection;
/** @var string */
private $tableName;
public function setUp() {
$this->connection = \OC_DB::getConnection();
if (!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySqlPlatform) {
$this->markTestSkipped("Test only relevant on MySql");
}
$dbPrefix = \OC::$server->getConfig()->getSystemValue("dbtableprefix");
$this->tableName = uniqid($dbPrefix . "_enum_bit_test");
$this->connection->exec("CREATE TABLE $this->tableName(b BIT, e ENUM('1','2','3','4'))");
}
public function tearDown() {
$this->connection->getSchemaManager()->dropTable($this->tableName);
}
public function testNonOCTables() {
$manager = new \OC\DB\MDB2SchemaManager($this->connection);
$manager->updateDbFromStructure(__DIR__ . '/testschema.xml');
$this->assertTrue(true);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment