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
6d36298d
Commit
6d36298d
authored
Dec 04, 2010
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DBAL-70 - MySQL and DB2 did handle floats as Doctrine decimal.
parent
8dcdf5a9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
7 deletions
+29
-7
DB2Platform.php
lib/Doctrine/DBAL/Platforms/DB2Platform.php
+2
-2
MySqlPlatform.php
lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
+3
-3
Column.php
lib/Doctrine/DBAL/Schema/Column.php
+1
-1
SchemaManagerFunctionalTestCase.php
...BAL/Functional/Schema/SchemaManagerFunctionalTestCase.php
+23
-1
No files found.
lib/Doctrine/DBAL/Platforms/DB2Platform.php
View file @
6d36298d
...
...
@@ -37,8 +37,8 @@ class DB2Platform extends AbstractPlatform
'character'
=>
'string'
,
'clob'
=>
'text'
,
'decimal'
=>
'decimal'
,
'double'
=>
'
decimal
'
,
'real'
=>
'
decimal
'
,
'double'
=>
'
float
'
,
'real'
=>
'
float
'
,
'timestamp'
=>
'datetime'
,
);
}
...
...
lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
View file @
6d36298d
...
...
@@ -591,9 +591,9 @@ class MySqlPlatform extends AbstractPlatform
'datetime'
=>
'datetime'
,
'timestamp'
=>
'datetime'
,
'time'
=>
'time'
,
'float'
=>
'
decimal
'
,
'double'
=>
'
decimal
'
,
'real'
=>
'
decimal
'
,
'float'
=>
'
float
'
,
'double'
=>
'
float
'
,
'real'
=>
'
float
'
,
'decimal'
=>
'decimal'
,
'numeric'
=>
'decimal'
,
'year'
=>
'date'
,
...
...
lib/Doctrine/DBAL/Schema/Column.php
View file @
6d36298d
...
...
@@ -46,7 +46,7 @@ class Column extends AbstractAsset
/**
* @var int
*/
protected
$_precision
=
0
;
protected
$_precision
=
1
0
;
/**
* @var int
...
...
tests/Doctrine/Tests/DBAL/Functional/Schema/SchemaManagerFunctionalTestCase.php
View file @
6d36298d
...
...
@@ -93,7 +93,7 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
$this
->
assertTrue
(
$foundTable
,
"The 'list_tables_test' table has to be found."
);
}
public
function
test
ListTableColumns
()
public
function
create
ListTableColumns
()
{
$table
=
new
\Doctrine\DBAL\Schema\Table
(
'list_table_columns'
);
$table
->
addColumn
(
'id'
,
'integer'
,
array
(
'notnull'
=>
true
));
...
...
@@ -104,6 +104,13 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
$table
->
addColumn
(
'baz2'
,
'time'
);
$table
->
addColumn
(
'baz3'
,
'date'
);
return
$table
;
}
public
function
testListTableColumns
()
{
$table
=
$this
->
createListTableColumns
();
$this
->
_sm
->
dropAndCreateTable
(
$table
);
$columns
=
$this
->
_sm
->
listTableColumns
(
'list_table_columns'
);
...
...
@@ -163,6 +170,21 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
$this
->
assertType
(
'array'
,
$columns
[
'baz3'
]
->
getPlatformOptions
());
}
public
function
testDiffListTableColumns
()
{
if
(
$this
->
_sm
->
getDatabasePlatform
()
->
getName
()
==
'oracle'
)
{
$this
->
markTestSkipped
(
'Does not work with Oracle, since it cannot detect DateTime, Date and Time differenecs (at the moment).'
);
}
$offlineTable
=
$this
->
createListTableColumns
();
$onlineTable
=
$this
->
_sm
->
listTableDetails
(
'list_table_columns'
);
$comparator
=
new
\Doctrine\DBAL\Schema\Comparator
();
$diff
=
$comparator
->
diffTable
(
$offlineTable
,
$onlineTable
);
$this
->
assertFalse
(
$diff
,
"No differences should be detected with the offline vs online schema."
);
}
public
function
testListTableIndexes
()
{
$table
=
$this
->
getTestTable
(
'list_table_indexes_test'
);
...
...
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