Skip to content

Commit

Permalink
Merge pull request #1406 from phalcon/fix/#1399-double-type-size
Browse files Browse the repository at this point in the history
#1399 - Exclude size for TYPE_DOUBLE
  • Loading branch information
Jeckerson authored Dec 21, 2019
2 parents 50d9b50 + e042912 commit 3162475
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions scripts/Phalcon/Mvc/Model/Migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -930,13 +930,12 @@ public function getConnection()
*/
public static function columnHasSize($type)
{
$adapter = self::$databaseConfig->path('adapter');
if ($adapter == 'Postgresql' &&
in_array($type, [Column::TYPE_BOOLEAN, Column::TYPE_INTEGER, Column::TYPE_BIGINTEGER])) {
$postgresTypes = [Column::TYPE_BOOLEAN, Column::TYPE_INTEGER, Column::TYPE_BIGINTEGER, Column::TYPE_DOUBLE];
if (self::$databaseConfig->path('adapter') == 'Postgresql' && in_array($type, $postgresTypes)) {
return false;
}

if (in_array($type, [Column::TYPE_TEXT, Column::TYPE_DATE, Column::TYPE_DATETIME])) {
if (in_array($type, [Column::TYPE_TEXT, Column::TYPE_DATE, Column::TYPE_DATETIME, Column::TYPE_DOUBLE])) {
return false;
}

Expand Down

0 comments on commit 3162475

Please sign in to comment.