Skip to content

Commit

Permalink
Add scale for decimal
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamsxin committed Jul 25, 2013
1 parent a45d712 commit a3456d8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/Phalcon/Mvc/Model/Migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,14 @@ public static function generate($version, $table, $exportData=null)
}

if ($field->getSize()) {
$fieldDefinition[] = "'size' => " . $field->getSize();
} else {
$fieldDefinition[] = "'size' => 1";
}
$fieldDefinition[] = "'size' => " . $field->getSize();
} else {
$fieldDefinition[] = "'size' => 1";
}

if ($field->getScale()) {
$fieldDefinition[] = "'scale' => " . $field->getScale();
}

if ($oldColumn != null) {
$fieldDefinition[] = "'after' => '" . $oldColumn . "'";
Expand Down

0 comments on commit a3456d8

Please sign in to comment.