lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
private function typeChangeBreaksDefaultValue(ColumnDiff $columnDiff) : bool
    {
        if (! $columnDiff->fromColumn) {
            return $columnDiff->hasChanged('type');
        }

        $oldTypeIsNumeric = $this->isNumericType($columnDiff->fromColumn->getType());
        $newTypeIsNumeric = $this->isNumericType($columnDiff->column->getType());

        // default should not be changed when switching between numeric types and the default comes from a sequence
        return $columnDiff->hasChanged('type')
            && ! ($oldTypeIsNumeric && $newTypeIsNumeric && $columnDiff->column->getAutoincrement());
    }
private function typeChangeBreaksDefaultValue(ColumnDiff $columnDiff) : bool
    {
        if (! $columnDiff->fromColumn) {
            return $columnDiff->hasChanged('type');
        }

        $oldTypeIsNumeric = $this->isNumericType($columnDiff->fromColumn->getType());
        $newTypeIsNumeric = $this->isNumericType($columnDiff->column->getType());

        // default should not be changed when switching between numeric types and the default comes from a sequence
        return $columnDiff->hasChanged('type')
            && ! ($oldTypeIsNumeric && $newTypeIsNumeric && $columnDiff->column->getAutoincrement());
    }
private function typeChangeBreaksDefaultValue ( ColumnDiff $ columnDiff ) : bool { if ( ! $ columnDiff -> fromColumn ) { return $ columnDiff -> hasChanged ( 'type' ) ; } $ oldTypeIsNumeric = $ this -> isNumericType ( $ columnDiff -> fromColumn -> getType ( ) ) ; $ newTypeIsNumeric = $ this -> isNumericType ( $ columnDiff -> column -> getType ( ) ) ; // default should not be changed when switching between numeric types and the default comes from a sequence return $ columnDiff -> hasChanged ( 'type' ) && ! ( $ oldTypeIsNumeric && $ newTypeIsNumeric && $ columnDiff -> column -> getAutoincrement ( ) ) ; }
Check whether the type of a column is changed in a way that invalidates the default value for the column
Check whether the type of a column is changed in a way that invalidates the default value for the column