Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix for decimal fields with precision. #226

Merged
merged 2 commits into from

3 participants

@bobdenotter

These fields have no spaces in the length, so the 'explode' fails. Omit the space from the code, and it works. Even if there were a space, it would still work, because of the array_map("trim", ..).

arr(7) 
[
    "cid"        => str(2) "11"
    "name"       => str(6) "nummer"
    "type"       => str(7) "DECIMAL"
    "notnull"    => str(1) "1"
    "dflt_value" => str(1) "0"
    "pk"         => str(1) "0"
    "length"     => str(4) "18,9"
]
@doctrinebot
Collaborator

Hello,

thank you for positing this Pull Request. I have automatically opened an issue on our Jira Bug Tracker for you with the details of this Pull-Request. See the Link:

http://doctrine-project.org/jira/browse/DBAL-380

@beberlei beberlei merged commit b9ada57 into doctrine:master
@bobdenotter bobdenotter referenced this pull request in bolt/bolt
Closed

Use tagging for Packagist #28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 12, 2012
  1. @bobdenotter
Commits on Nov 19, 2012
  1. @bobdenotter
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php
View
5 lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php
@@ -163,7 +163,10 @@ protected function _getPortableTableColumnDefinition($tableColumn)
case 'decimal':
case 'numeric':
if (isset($tableColumn['length'])) {
- list($precision, $scale) = array_map('trim', explode(', ', $tableColumn['length']));
+ if (strpos($tableColumn['length'], ',') === false) {
+ $tableColumn['length'] .= ",0";
+ }
+ list($precision, $scale) = array_map('trim', explode(',', $tableColumn['length']));
}
$length = null;
break;
Something went wrong with that request. Please try again.