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
4f7df7c1
Commit
4f7df7c1
authored
Jan 23, 2017
by
Marco Pivetta
Committed by
GitHub
Jan 23, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2612 from deeky666/DBAL-2555
[DBAL-2555] Fix date and datetimetz type mapping on Oracle
parents
292a6516
31fac117
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
2 deletions
+27
-2
OraclePlatform.php
lib/Doctrine/DBAL/Platforms/OraclePlatform.php
+1
-1
OracleSchemaManager.php
lib/Doctrine/DBAL/Schema/OracleSchemaManager.php
+1
-1
OracleSchemaManagerTest.php
.../Tests/DBAL/Functional/Schema/OracleSchemaManagerTest.php
+19
-0
OraclePlatformTest.php
tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php
+6
-0
No files found.
lib/Doctrine/DBAL/Platforms/OraclePlatform.php
View file @
4f7df7c1
...
...
@@ -1126,7 +1126,7 @@ END;';
'nvarchar2'
=>
'string'
,
'char'
=>
'string'
,
'nchar'
=>
'string'
,
'date'
=>
'date
time
'
,
'date'
=>
'date'
,
'timestamp'
=>
'datetime'
,
'timestamptz'
=>
'datetimetz'
,
'float'
=>
'float'
,
...
...
lib/Doctrine/DBAL/Schema/OracleSchemaManager.php
View file @
4f7df7c1
...
...
@@ -102,7 +102,7 @@ class OracleSchemaManager extends AbstractSchemaManager
$dbType
=
strtolower
(
$tableColumn
[
'data_type'
]);
if
(
strpos
(
$dbType
,
"timestamp("
)
===
0
)
{
if
(
strpos
(
$dbType
,
"
WITH TIME ZONE
"
))
{
if
(
strpos
(
$dbType
,
"
with time zone
"
))
{
$dbType
=
"timestamptz"
;
}
else
{
$dbType
=
"timestamp"
;
...
...
tests/Doctrine/Tests/DBAL/Functional/Schema/OracleSchemaManagerTest.php
View file @
4f7df7c1
...
...
@@ -231,4 +231,23 @@ class OracleSchemaManagerTest extends SchemaManagerFunctionalTestCase
$columns
=
$this
->
_sm
->
listTableColumns
(
$table
->
getName
(),
$this
->
_conn
->
getUsername
());
$this
->
assertCount
(
7
,
$columns
);
}
/**
* @group DBAL-2555
*/
public
function
testListTableDateTypeColumns
()
{
$table
=
new
Table
(
'tbl_date'
);
$table
->
addColumn
(
'col_date'
,
'date'
);
$table
->
addColumn
(
'col_datetime'
,
'datetime'
);
$table
->
addColumn
(
'col_datetimetz'
,
'datetimetz'
);
$this
->
_sm
->
dropAndCreateTable
(
$table
);
$columns
=
$this
->
_sm
->
listTableColumns
(
'tbl_date'
);
$this
->
assertSame
(
'date'
,
$columns
[
'col_date'
]
->
getType
()
->
getName
());
$this
->
assertSame
(
'datetime'
,
$columns
[
'col_datetime'
]
->
getType
()
->
getName
());
$this
->
assertSame
(
'datetimetz'
,
$columns
[
'col_datetimetz'
]
->
getType
()
->
getName
());
}
}
tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php
View file @
4f7df7c1
...
...
@@ -412,6 +412,9 @@ class OraclePlatformTest extends AbstractPlatformTestCase
$this
->
assertEquals
(
$expectedSql
,
$this
->
_platform
->
getAlterTableSQL
(
$tableDiff
));
}
/**
* @group DBAL-2555
*/
public
function
testInitializesDoctrineTypeMappings
()
{
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'long raw'
));
...
...
@@ -419,6 +422,9 @@ class OraclePlatformTest extends AbstractPlatformTestCase
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'raw'
));
$this
->
assertSame
(
'binary'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'raw'
));
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'date'
));
$this
->
assertSame
(
'date'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'date'
));
}
protected
function
getBinaryMaxLength
()
...
...
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