Commit 31be2519 authored by beberlei's avatar beberlei

[2.0] DDC-169 - Fix build, Postgres, Oracle and Sqlite made some minor...

[2.0] DDC-169 - Fix build, Postgres, Oracle and Sqlite made some minor troubles with regards to sequences.
parent af48974a
......@@ -263,7 +263,8 @@ class OraclePlatform extends AbstractPlatform
public function getListSequencesSql($database)
{
return 'SELECT sequence_name, min_value, increment_by FROM sys.user_sequences';
return "SELECT sequence_name, min_value, increment_by FROM sys.all_sequences ".
"WHERE SEQUENCE_OWNER = '".strtoupper($database)."'";
}
public function getCreateTableSql($table, array $columns, array $options = array())
......
......@@ -444,6 +444,11 @@ class SqlitePlatform extends AbstractPlatform
return false;
}
public function supportsSequences()
{
return false;
}
/**
* Get the platform name for this instance
*
......
......@@ -153,7 +153,8 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
protected function _getPortableSequenceDefinition($sequence)
{
return $sequence['relname'];
$data = $this->_conn->fetchAll('SELECT start_value, increment_by FROM '.$sequence['relname']);
return new Sequence($sequence['relname'], $data[0]['increment_by'], $data[0]['start_value']);
}
protected function _getPortableTableConstraintDefinition($tableConstraint)
......
......@@ -8,13 +8,6 @@ require_once __DIR__ . '/../../../TestInit.php';
class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
{
public function testListSequences()
{
$this->createTestTable('list_sequences_test');
$sequences = $this->_sm->listSequences();
$this->assertEquals(true, in_array('list_sequences_test_id_seq', $sequences));
}
public function testListTableConstraints()
{
$this->createTestTable('list_table_constraints_test');
......
......@@ -36,14 +36,6 @@ class SqliteSchemaManagerTest extends SchemaManagerFunctionalTestCase
$this->_sm->listTriggers();
}
public function testListSequences()
{
$this->createTestTable('list_sequences_test');
$sequences = $this->_sm->listSequences();
$this->assertEquals('list_sequences_test', $sequences[0]['name']);
$this->assertEquals('sqlite_sequence', $sequences[1]['name']);
}
public function testListTableConstraints()
{
// TODO: Implement support for constraints/foreign keys to be specified
......
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