diff --git a/lib/Doctrine/DBAL/Platforms/MsSqlPlatform.php b/lib/Doctrine/DBAL/Platforms/MsSqlPlatform.php index c323fbf15..dcf23bf1e 100644 --- a/lib/Doctrine/DBAL/Platforms/MsSqlPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/MsSqlPlatform.php @@ -325,14 +325,6 @@ class MsSqlPlatform extends AbstractPlatform return 'SET TRANSACTION ISOLATION LEVEL ' . $this->_getTransactionIsolationLevelSql($level); } - /** - * @override - */ - public function getBooleanTypeDeclarationSql(array $field) - { - return 'BIT'; - } - /** * @override */ @@ -374,7 +366,9 @@ class MsSqlPlatform extends AbstractPlatform : ($length ? 'VARCHAR(' . $length . ')' : 'TEXT'); } - /** @override */ + /** + * @override + */ protected function _getCommonIntegerTypeDeclarationSql(array $columnDef) { $autoinc = ''; diff --git a/lib/Doctrine/DBAL/Platforms/OraclePlatform.php b/lib/Doctrine/DBAL/Platforms/OraclePlatform.php index 090b8e69b..2163f6db5 100644 --- a/lib/Doctrine/DBAL/Platforms/OraclePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/OraclePlatform.php @@ -193,14 +193,6 @@ class OraclePlatform extends AbstractPlatform return 'TIMESTAMP(0) WITH TIME ZONE'; } - /** - * @override - */ - public function getBooleanTypeDeclarationSql(array $field) - { - return 'NUMBER(1)'; - } - /** * @override */ diff --git a/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php b/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php index 48aff9dcb..5becb6934 100644 --- a/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php @@ -712,14 +712,6 @@ class PostgreSqlPlatform extends AbstractPlatform return 'DATE'; } - /** - * @override - */ - public function getBooleanTypeDeclarationSql(array $field) - { - return 'BOOLEAN'; - } - /** * @override */ diff --git a/tests/Doctrine/Tests/DBAL/Mocks/MockPlatform.php b/tests/Doctrine/Tests/DBAL/Mocks/MockPlatform.php index c354f8fc2..43eb93533 100644 --- a/tests/Doctrine/Tests/DBAL/Mocks/MockPlatform.php +++ b/tests/Doctrine/Tests/DBAL/Mocks/MockPlatform.php @@ -6,6 +6,7 @@ use Doctrine\DBAL\Platforms; class MockPlatform extends \Doctrine\DBAL\Platforms\AbstractPlatform { + public function getBooleanTypeDeclarationSql(array $columnDef) {} public function getIntegerTypeDeclarationSql(array $columnDef) {} public function getBigIntTypeDeclarationSql(array $columnDef) {} public function getSmallIntTypeDeclarationSql(array $columnDef) {} diff --git a/tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php b/tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php index a588139b7..8fdfe871b 100644 --- a/tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php +++ b/tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php @@ -40,6 +40,9 @@ class DatabasePlatformMock extends \Doctrine\DBAL\Platforms\AbstractPlatform return $this->_sequenceNextValSql; } + /** @override */ + public function getBooleanTypeDeclarationSql(array $field) {} + /** @override */ public function getIntegerTypeDeclarationSql(array $field) {} diff --git a/tests/Doctrine/Tests/Models/Generic/DecimalModel.php b/tests/Doctrine/Tests/Models/Generic/DecimalModel.php index 3ea1d03ce..a401c1975 100644 --- a/tests/Doctrine/Tests/Models/Generic/DecimalModel.php +++ b/tests/Doctrine/Tests/Models/Generic/DecimalModel.php @@ -4,7 +4,7 @@ namespace Doctrine\Tests\Models\Generic; /** * @Entity - * @Table(name="date_time_model") + * @Table(name="decimal_model") */ class DecimalModel { diff --git a/tests/Doctrine/Tests/ORM/Functional/SchemaTool/MySqlSchemaToolTest.php b/tests/Doctrine/Tests/ORM/Functional/SchemaTool/MySqlSchemaToolTest.php index 86e160d00..db9bf376c 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SchemaTool/MySqlSchemaToolTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SchemaTool/MySqlSchemaToolTest.php @@ -47,7 +47,20 @@ class MySqlSchemaToolTest extends \Doctrine\Tests\OrmFunctionalTestCase $sql = $tool->getCreateSchemaSql($classes); $this->assertEquals(1, count($sql)); - $this->assertEquals("CREATE TABLE date_time_model (id INT AUTO_INCREMENT NOT NULL, decimal NUMERIC(2, 5) NOT NULL, PRIMARY KEY(id)) ENGINE = InnoDB", $sql[0]); + $this->assertEquals("CREATE TABLE decimal_model (id INT AUTO_INCREMENT NOT NULL, decimal NUMERIC(2, 5) NOT NULL, PRIMARY KEY(id)) ENGINE = InnoDB", $sql[0]); + } + + public function testGetCreateSchemaSql3() + { + $classes = array( + $this->_em->getClassMetadata('Doctrine\Tests\Models\Generic\BooleanModel') + ); + + $tool = new SchemaTool($this->_em); + $sql = $tool->getCreateSchemaSql($classes); + + $this->assertEquals(1, count($sql)); + $this->assertEquals("CREATE TABLE boolean_model (id INT AUTO_INCREMENT NOT NULL, boolean DEFAULT 1 NOT NULL, PRIMARY KEY(id)) ENGINE = InnoDB", $sql[0]); } public function testGetUpdateSchemaSql()