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
035b079c
Commit
035b079c
authored
Jan 02, 2012
by
Kim Hemsø Rasmussen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use DATA_TYPE to figure out column type. Fixed triming of column names for spaces and etc.
parent
0b03421a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
DrizzlePlatform.php
lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php
+3
-1
DrizzleSchemaManager.php
lib/Doctrine/DBAL/Schema/DrizzleSchemaManager.php
+3
-3
No files found.
lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php
View file @
035b079c
...
...
@@ -134,6 +134,8 @@ class DrizzlePlatform extends AbstractPlatform
'datetime'
=>
'datetime'
,
'date'
=>
'date'
,
'time'
=>
'time'
,
'text'
=>
'text'
,
'timestamp'
=>
'datetime'
,
);
}
...
...
@@ -183,7 +185,7 @@ class DrizzlePlatform extends AbstractPlatform
$database
=
'DATABASE()'
;
}
return
"SELECT COLUMN_NAME,
COLUMN
_TYPE, COLUMN_COMMENT, IS_NULLABLE, IS_AUTO_INCREMENT, CHARACTER_MAXIMUM_LENGTH, COLUMN_DEFAULT,"
.
return
"SELECT COLUMN_NAME,
DATA
_TYPE, COLUMN_COMMENT, IS_NULLABLE, IS_AUTO_INCREMENT, CHARACTER_MAXIMUM_LENGTH, COLUMN_DEFAULT,"
.
" NUMERIC_PRECISION, NUMERIC_SCALE"
.
" FROM DATA_DICTIONARY.COLUMNS"
.
" WHERE TABLE_SCHEMA="
.
$database
.
" AND TABLE_NAME = '"
.
$table
.
"'"
;
...
...
lib/Doctrine/DBAL/Schema/DrizzleSchemaManager.php
View file @
035b079c
...
...
@@ -29,7 +29,7 @@ class DrizzleSchemaManager extends AbstractSchemaManager
protected
function
_getPortableTableColumnDefinition
(
$tableColumn
)
{
$tableName
=
$tableColumn
[
'COLUMN_NAME'
];
$dbType
=
strtolower
(
$tableColumn
[
'
COLUMN
_TYPE'
]);
$dbType
=
strtolower
(
$tableColumn
[
'
DATA
_TYPE'
]);
$type
=
$this
->
_platform
->
getDoctrineTypeMapping
(
$dbType
);
$type
=
$this
->
extractDoctrineTypeFromComment
(
$tableColumn
[
'COLUMN_COMMENT'
],
$type
);
...
...
@@ -62,12 +62,12 @@ class DrizzleSchemaManager extends AbstractSchemaManager
{
$columns
=
array
();
foreach
(
explode
(
','
,
$tableForeignKey
[
'CONSTRAINT_COLUMNS'
])
as
$value
)
{
$columns
[]
=
trim
(
$value
,
'`'
);
$columns
[]
=
trim
(
$value
,
'
`'
);
}
$ref_columns
=
array
();
foreach
(
explode
(
','
,
$tableForeignKey
[
'REFERENCED_TABLE_COLUMNS'
])
as
$value
)
{
$ref_columns
[]
=
trim
(
$value
,
'`'
);
$ref_columns
[]
=
trim
(
$value
,
'
`'
);
}
return
new
ForeignKeyConstraint
(
...
...
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