Commit fbce4b50 authored by Guilherme Blanco's avatar Guilherme Blanco

Merge pull request #324 from valerio8787/master

Update SQLServer2008Platform.php (support  MS SQL Server type datetimeoffset(6))
parents 3253f7a1 151a0fad
......@@ -52,6 +52,14 @@ class SQLServer2008Platform extends SQLServer2005Platform
{
return 'TIME(0)';
}
/**
* {@inheritDoc}
*/
public function getDateTimeTzTypeDeclarationSQL(array $fieldDeclaration)
{
return 'DATETIMEOFFSET(6)';
}
/**
* {@inheritDoc}
......@@ -96,6 +104,7 @@ class SQLServer2008Platform extends SQLServer2005Platform
$this->doctrineTypeMapping['datetime2'] = 'datetime';
$this->doctrineTypeMapping['date'] = 'date';
$this->doctrineTypeMapping['time'] = 'time';
$this->doctrineTypeMapping['datetimeoffset'] = 'datetimetz';
}
/**
......
......@@ -961,7 +961,6 @@ class SQLServerPlatform extends AbstractPlatform
'real' => 'float',
'double' => 'float',
'double precision' => 'float',
'datetimeoffset' => 'datetimetz',
'smalldatetime' => 'datetime',
'datetime' => 'datetime',
'char' => 'string',
......
<?php
namespace Doctrine\Tests\DBAL\Platforms;
use Doctrine\DBAL\Platforms\SQLServer2008Platform;
class SQLServer2008PlatformTest extends SQLServerPlatformTest
{
public function createPlatform()
{
return new SQLServer2008Platform;
}
public function testGeneratesTypeDeclarationForDateTimeTz()
{
$this->assertEquals(
'DATETIMEOFFSET(6)',
$this->_platform->getDateTimeTzTypeDeclarationSQL(
array())
);
}
}
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