Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
0b609e49
Commit
0b609e49
authored
Dec 24, 2013
by
Steve Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimize non-native GUID type declaration
parent
6ccd739c
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
70 additions
and
1 deletion
+70
-1
AbstractPlatform.php
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
+4
-1
AbstractMySQLPlatformTestCase.php
...ne/Tests/DBAL/Platforms/AbstractMySQLPlatformTestCase.php
+8
-0
AbstractPlatformTestCase.php
...octrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php
+10
-0
AbstractPostgreSqlPlatformTestCase.php
...sts/DBAL/Platforms/AbstractPostgreSqlPlatformTestCase.php
+8
-0
AbstractSQLServerPlatformTestCase.php
...ests/DBAL/Platforms/AbstractSQLServerPlatformTestCase.php
+8
-0
DB2PlatformTest.php
tests/Doctrine/Tests/DBAL/Platforms/DB2PlatformTest.php
+8
-0
OraclePlatformTest.php
tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php
+8
-0
SQLAnywherePlatformTest.php
...Doctrine/Tests/DBAL/Platforms/SQLAnywherePlatformTest.php
+8
-0
SqlitePlatformTest.php
tests/Doctrine/Tests/DBAL/Platforms/SqlitePlatformTest.php
+8
-0
No files found.
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
View file @
0b609e49
...
...
@@ -297,7 +297,7 @@ abstract class AbstractPlatform
/**
* Returns the SQL snippet to declare a GUID/UUID field.
*
* By default this maps directly to a
VARCHAR
and only maps to more
* By default this maps directly to a
CHAR(36)
and only maps to more
* special datatypes when the underlying databases support this datatype.
*
* @param array $field
...
...
@@ -306,6 +306,9 @@ abstract class AbstractPlatform
*/
public
function
getGuidTypeDeclarationSQL
(
array
$field
)
{
$field
[
'length'
]
=
36
;
$field
[
'fixed'
]
=
true
;
return
$this
->
getVarcharTypeDeclarationSQL
(
$field
);
}
...
...
tests/Doctrine/Tests/DBAL/Platforms/AbstractMySQLPlatformTestCase.php
View file @
0b609e49
...
...
@@ -596,4 +596,12 @@ abstract class AbstractMySQLPlatformTestCase extends AbstractPlatformTestCase
"CHANGE `select` `select` VARCHAR(255) NOT NULL COMMENT 'Reserved keyword 3'"
);
}
/**
* @group DBAL-423
*/
public
function
testReturnsGuidTypeDeclarationSQL
()
{
$this
->
assertSame
(
'CHAR(36)'
,
$this
->
_platform
->
getGuidTypeDeclarationSQL
(
array
()));
}
}
tests/Doctrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php
View file @
0b609e49
...
...
@@ -946,4 +946,14 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
$this
->
_platform
->
quoteStringLiteral
(
$c
)
);
}
/**
* @group DBAL-423
*
* @expectedException \Doctrine\DBAL\DBALException
*/
public
function
testReturnsGuidTypeDeclarationSQL
()
{
$this
->
_platform
->
getGuidTypeDeclarationSQL
(
array
());
}
}
tests/Doctrine/Tests/DBAL/Platforms/AbstractPostgreSqlPlatformTestCase.php
View file @
0b609e49
...
...
@@ -664,4 +664,12 @@ abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCa
$this
->
_platform
->
getCommentOnColumnSQL
(
'mytable'
,
'id'
,
null
)
);
}
/**
* @group DBAL-423
*/
public
function
testReturnsGuidTypeDeclarationSQL
()
{
$this
->
assertSame
(
'UUID'
,
$this
->
_platform
->
getGuidTypeDeclarationSQL
(
array
()));
}
}
tests/Doctrine/Tests/DBAL/Platforms/AbstractSQLServerPlatformTestCase.php
View file @
0b609e49
...
...
@@ -1101,4 +1101,12 @@ abstract class AbstractSQLServerPlatformTestCase extends AbstractPlatformTestCas
),
);
}
/**
* @group DBAL-423
*/
public
function
testReturnsGuidTypeDeclarationSQL
()
{
$this
->
assertSame
(
'UNIQUEIDENTIFIER'
,
$this
->
_platform
->
getGuidTypeDeclarationSQL
(
array
()));
}
}
tests/Doctrine/Tests/DBAL/Platforms/DB2PlatformTest.php
View file @
0b609e49
...
...
@@ -463,4 +463,12 @@ class DB2PlatformTest extends AbstractPlatformTestCase
'RENAME INDEX "schema"."foo" TO "bar"'
,
);
}
/**
* @group DBAL-423
*/
public
function
testReturnsGuidTypeDeclarationSQL
()
{
$this
->
assertSame
(
'CHAR(36)'
,
$this
->
_platform
->
getGuidTypeDeclarationSQL
(
array
()));
}
}
tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php
View file @
0b609e49
...
...
@@ -484,4 +484,12 @@ class OraclePlatformTest extends AbstractPlatformTestCase
'ALTER INDEX "schema"."foo" RENAME TO "bar"'
,
);
}
/**
* @group DBAL-423
*/
public
function
testReturnsGuidTypeDeclarationSQL
()
{
$this
->
assertSame
(
'CHAR(36)'
,
$this
->
_platform
->
getGuidTypeDeclarationSQL
(
array
()));
}
}
tests/Doctrine/Tests/DBAL/Platforms/SQLAnywherePlatformTest.php
View file @
0b609e49
...
...
@@ -855,4 +855,12 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
'ALTER INDEX "foo" ON "schema"."table" RENAME TO "bar"'
,
);
}
/**
* @group DBAL-423
*/
public
function
testReturnsGuidTypeDeclarationSQL
()
{
$this
->
assertSame
(
'UNIQUEIDENTIFIER'
,
$this
->
_platform
->
getGuidTypeDeclarationSQL
(
array
()));
}
}
tests/Doctrine/Tests/DBAL/Platforms/SqlitePlatformTest.php
View file @
0b609e49
...
...
@@ -552,4 +552,12 @@ class SqlitePlatformTest extends AbstractPlatformTestCase
'when used with schemas.'
);
}
/**
* @group DBAL-423
*/
public
function
testReturnsGuidTypeDeclarationSQL
()
{
$this
->
assertSame
(
'CHAR(36)'
,
$this
->
_platform
->
getGuidTypeDeclarationSQL
(
array
()));
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment