Commit c2a40708 authored by Benjamin Eberlei's avatar Benjamin Eberlei

Reformulate table creation logic

parent 53ffb05e
...@@ -17,8 +17,6 @@ class TypeConversionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -17,8 +17,6 @@ class TypeConversionTest extends \Doctrine\Tests\DbalFunctionalTestCase
/* @var $sm \Doctrine\DBAL\Schema\AbstractSchemaManager */ /* @var $sm \Doctrine\DBAL\Schema\AbstractSchemaManager */
$sm = $this->_conn->getSchemaManager(); $sm = $this->_conn->getSchemaManager();
if (!$sm->tablesExist(array('type_conversion'))) {
$table = new \Doctrine\DBAL\Schema\Table("type_conversion"); $table = new \Doctrine\DBAL\Schema\Table("type_conversion");
$table->addColumn('id', 'integer', array('notnull' => false)); $table->addColumn('id', 'integer', array('notnull' => false));
$table->addColumn('test_string', 'string', array('notnull' => false)); $table->addColumn('test_string', 'string', array('notnull' => false));
...@@ -36,9 +34,12 @@ class TypeConversionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -36,9 +34,12 @@ class TypeConversionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table->addColumn('test_decimal', 'decimal', array('notnull' => false, 'scale' => 2, 'precision' => 10)); $table->addColumn('test_decimal', 'decimal', array('notnull' => false, 'scale' => 2, 'precision' => 10));
$table->setPrimaryKey(array('id')); $table->setPrimaryKey(array('id'));
try {
foreach ($this->_conn->getDatabasePlatform()->getCreateTableSQL($table) AS $sql) { foreach ($this->_conn->getDatabasePlatform()->getCreateTableSQL($table) AS $sql) {
$this->_conn->executeQuery($sql); $this->_conn->executeQuery($sql);
} }
} catch(\Exception $e) {
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment