Commit 962ecab7 authored by beberlei's avatar beberlei

[2.0] DDC-312 - Prepared View and Trigger support in DBAL\Schema

parent 22edbcec
......@@ -806,7 +806,7 @@ abstract class AbstractSchemaManager
}
$tables = $this->listTables();
return new Schema($tables, $sequences, $this->createSchemaConfig());
return new Schema($tables, $sequences, array(), array(), $this->createSchemaConfig());
}
/**
......
......@@ -54,9 +54,11 @@ class Schema extends AbstractAsset
/**
* @param array $tables
* @param array $sequences
* @param array $views
* @param array $triggers
* @param SchemaConfig $schemaConfig
*/
public function __construct(array $tables=array(), array $sequences=array(), SchemaConfig $schemaConfig=null)
public function __construct(array $tables=array(), array $sequences=array(), array $views = array(), array $triggers = array(), SchemaConfig $schemaConfig=null)
{
if ($schemaConfig == null) {
$schemaConfig = new SchemaConfig();
......
......@@ -114,7 +114,7 @@ class SchemaTool
$metadataSchemaConfig->setMaxIdentifierLength(63);
$sm = $this->_em->getConnection()->getSchemaManager();
$schema = new \Doctrine\DBAL\Schema\Schema(array(), array(), $metadataSchemaConfig);
$schema = new \Doctrine\DBAL\Schema\Schema(array(), array(), array(), array(), $metadataSchemaConfig);
foreach ($classes as $class) {
if (isset($processedClasses[$class->name]) || $class->isMappedSuperclass) {
......
......@@ -47,16 +47,6 @@ class OracleSchemaManagerTest extends SchemaManagerFunctionalTestCase
$this->assertEquals(true, $found);
}
public function testListViews()
{
$this->_sm->dropAndCreateView('test_create_view', 'SELECT * FROM sys.user_tables');
$views = $this->_sm->listViews();
$view = end($views);
$this->assertEquals('TEST_CREATE_VIEW', $view['name']);
}
public function testRenameTable()
{
$this->_sm->tryMethod('DropTable', 'list_tables_test');
......
......@@ -91,8 +91,8 @@ class ComparatorTest extends \PHPUnit_Framework_TestCase
$table = new Table('bugdb', array ('integerfield1' => new Column('integerfield1', Type::getType('integer'))));
$table->setSchemaConfig($schemaConfig);
$schema1 = new Schema( array($table), array(), $schemaConfig );
$schema2 = new Schema( array(), array(), $schemaConfig );
$schema1 = new Schema( array($table), array(), array(), array(), $schemaConfig );
$schema2 = new Schema( array(), array(), array(), array(), $schemaConfig );
$expected = new SchemaDiff( array(), array(), array('bugdb' => $table) );
......@@ -105,8 +105,8 @@ class ComparatorTest extends \PHPUnit_Framework_TestCase
$table = new Table('bugdb', array ('integerfield1' => new Column('integerfield1', Type::getType('integer'))));
$table->setSchemaConfig($schemaConfig);
$schema1 = new Schema( array(), array(), $schemaConfig );
$schema2 = new Schema( array($table), array(), $schemaConfig );
$schema1 = new Schema( array(), array(), array(), array(), $schemaConfig );
$schema2 = new Schema( array($table), array(), array(), array(), $schemaConfig );
$expected = new SchemaDiff( array('bugdb' => $table), array(), array() );
$this->assertEquals($expected, Comparator::compareSchemas( $schema1, $schema2 ) );
......
......@@ -193,7 +193,7 @@ class SchemaTest extends \PHPUnit_Framework_TestCase
$schemaConfig = new \Doctrine\DBAL\Schema\SchemaConfig();
$schemaConfig->setExplicitForeignKeyIndexes(false);
$schema = new Schema(array(), array(), $schemaConfig);
$schema = new Schema(array(), array(), array(), array(), $schemaConfig);
$this->assertFalse($schema->hasExplicitForeignKeyIndexes());
$schemaConfig->setExplicitForeignKeyIndexes(true);
......@@ -205,7 +205,7 @@ class SchemaTest extends \PHPUnit_Framework_TestCase
$schemaConfig = new \Doctrine\DBAL\Schema\SchemaConfig();
$schemaConfig->setMaxIdentifierLength(10);
$schema = new Schema(array(), array(), $schemaConfig);
$schema = new Schema(array(), array(), array(), array(), $schemaConfig);
$table = $schema->createTable("smalltable");
$table->createColumn('long_id', 'integer');
$table->addIndex(array('long_id'));
......
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