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
8a13144a
Commit
8a13144a
authored
Jan 23, 2017
by
Marco Pivetta
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix/#2555-#2612-fix-date-and-datetimetz-type-mapping-on-oracledb' into 2.5
Backport #2555 to 2.5 Backport #2612 to 2.5
parents
94016b98
226d9fed
Changes
4
Hide 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 @
8a13144a
...
...
@@ -1123,7 +1123,7 @@ LEFT JOIN user_cons_columns r_cols
'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 @
8a13144a
...
...
@@ -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 @
8a13144a
...
...
@@ -233,4 +233,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 @
8a13144a
...
...
@@ -414,6 +414,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'
));
...
...
@@ -421,6 +424,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