Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DBAL-203] SQLServerPlatform Refactoring
- Loading branch information
Showing
10 changed files
with
202 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
/* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* This software consists of voluntary contributions made by many individuals | ||
* and is licensed under the LGPL. For more information, see | ||
* <http://www.doctrine-project.org>. | ||
*/ | ||
|
||
namespace Doctrine\DBAL\Platforms; | ||
|
||
/** | ||
* Platform to ensure compatibility of Doctrine with SQLServer2008 version. | ||
* | ||
* Differences to SQL Server 2005 and before are that a new DATETIME2 type was | ||
* introduced that has a higher precision. | ||
*/ | ||
class SQLServer2008Platform extends SQLServer2005Platform | ||
{ | ||
/** | ||
* @override | ||
*/ | ||
public function getDateTimeTypeDeclarationSQL(array $fieldDeclaration) | ||
{ | ||
// 3 - microseconds precision length | ||
// http://msdn.microsoft.com/en-us/library/ms187819.aspx | ||
return 'DATETIME2(6)'; | ||
} | ||
|
||
/** | ||
* @override | ||
*/ | ||
public function getDateTypeDeclarationSQL(array $fieldDeclaration) | ||
{ | ||
return 'DATE'; | ||
} | ||
|
||
/** | ||
* @override | ||
*/ | ||
public function getTimeTypeDeclarationSQL(array $fieldDeclaration) | ||
{ | ||
return 'TIME(0)'; | ||
} | ||
|
||
/** | ||
* Adding Datetime2 Type | ||
*/ | ||
protected function initializeDoctrineTypeMappings() | ||
{ | ||
parent::initializeDoctrineTypeMappings(); | ||
$this->doctrineTypeMapping = array( | ||
'datetime2' => 'datetime', | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
tests/Doctrine/Tests/DBAL/Functional/Schema/MsSqlSchemaManagerTest.php
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
tests/Doctrine/Tests/DBAL/Functional/Schema/SQLServerSchemaManagerTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Doctrine\Tests\DBAL\Functional\Schema; | ||
|
||
use Doctrine\DBAL\Schema; | ||
|
||
class SQLServerSchemaManagerTest extends SchemaManagerFunctionalTestCase | ||
{ | ||
|
||
} |
Oops, something went wrong.
s/introced/introduced/ ?