Skip to content

Commit 3162475

Browse files
authored
Merge pull request #1406 from phalcon/fix/#1399-double-type-size
#1399 - Exclude size for TYPE_DOUBLE
2 parents 50d9b50 + e042912 commit 3162475

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

scripts/Phalcon/Mvc/Model/Migration.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -930,13 +930,12 @@ public function getConnection()
930930
*/
931931
public static function columnHasSize($type)
932932
{
933-
$adapter = self::$databaseConfig->path('adapter');
934-
if ($adapter == 'Postgresql' &&
935-
in_array($type, [Column::TYPE_BOOLEAN, Column::TYPE_INTEGER, Column::TYPE_BIGINTEGER])) {
933+
$postgresTypes = [Column::TYPE_BOOLEAN, Column::TYPE_INTEGER, Column::TYPE_BIGINTEGER, Column::TYPE_DOUBLE];
934+
if (self::$databaseConfig->path('adapter') == 'Postgresql' && in_array($type, $postgresTypes)) {
936935
return false;
937936
}
938937

939-
if (in_array($type, [Column::TYPE_TEXT, Column::TYPE_DATE, Column::TYPE_DATETIME])) {
938+
if (in_array($type, [Column::TYPE_TEXT, Column::TYPE_DATE, Column::TYPE_DATETIME, Column::TYPE_DOUBLE])) {
940939
return false;
941940
}
942941

0 commit comments

Comments
 (0)