Commit 615ce541 authored by Steve Müller's avatar Steve Müller

add SMALLSERIAL type support on PostgreSQL 9.2 platform

parent 2790ee79
......@@ -36,6 +36,18 @@ class PostgreSQL92Platform extends PostgreSqlPlatform
return 'JSON';
}
/**
* {@inheritdoc}
*/
public function getSmallIntTypeDeclarationSQL(array $field)
{
if ( ! empty($field['autoincrement'])) {
return 'SMALLSERIAL';
}
return parent::getSmallIntTypeDeclarationSQL($field);
}
/**
* {@inheritdoc}
*/
......
......@@ -30,6 +30,24 @@ class PostgreSQL92PlatformTest extends AbstractPostgreSqlPlatformTestCase
$this->assertSame('JSON', $this->_platform->getJsonTypeDeclarationSQL(array()));
}
public function testReturnsSmallIntTypeDeclarationSQL()
{
$this->assertSame(
'SMALLSERIAL',
$this->_platform->getSmallIntTypeDeclarationSQL(array('autoincrement' => true))
);
$this->assertSame(
'SMALLINT',
$this->_platform->getSmallIntTypeDeclarationSQL(array('autoincrement' => false))
);
$this->assertSame(
'SMALLINT',
$this->_platform->getSmallIntTypeDeclarationSQL(array())
);
}
/**
* @group DBAL-553
*/
......
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