lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
private function alterColumnRequiresDropDefaultConstraint(ColumnDiff $columnDiff)
    {
        // We can only decide whether to drop an existing default constraint
        // if we know the original default value.
        if (! $columnDiff->fromColumn instanceof Column) {
            return false;
        }

        // We only need to drop an existing default constraint if we know the
        // column was defined with a default value before.
        if ($columnDiff->fromColumn->getDefault() === null) {
            return false;
        }

        // We need to drop an existing default constraint if the column was
        // defined with a default value before and it has changed.
        if ($columnDiff->hasChanged('default')) {
            return true;
        }

        // We need to drop an existing default constraint if the column was
        // defined with a default value before and the native column type has changed.
        return $columnDiff->hasChanged('type') || $columnDiff->hasChanged('fixed');
    }
private function alterColumnRequiresDropDefaultConstraint(ColumnDiff $columnDiff)
    {
        // We can only decide whether to drop an existing default constraint
        // if we know the original default value.
        if (! $columnDiff->fromColumn instanceof Column) {
            return false;
        }

        // We only need to drop an existing default constraint if we know the
        // column was defined with a default value before.
        if ($columnDiff->fromColumn->getDefault() === null) {
            return false;
        }

        // We need to drop an existing default constraint if the column was
        // defined with a default value before and it has changed.
        if ($columnDiff->hasChanged('default')) {
            return true;
        }

        // We need to drop an existing default constraint if the column was
        // defined with a default value before and the native column type has changed.
        return $columnDiff->hasChanged('type') || $columnDiff->hasChanged('fixed');
    }
private function alterColumnRequiresDropDefaultConstraint ( ColumnDiff $ columnDiff ) { // We can only decide whether to drop an existing default constraint // if we know the original default value. if ( ! $ columnDiff -> fromColumn instanceof Column ) { return false ; } // We only need to drop an existing default constraint if we know the // column was defined with a default value before. if ( $ columnDiff -> fromColumn -> getDefault ( ) === null ) { return false ; } // We need to drop an existing default constraint if the column was // defined with a default value before and it has changed. if ( $ columnDiff -> hasChanged ( 'default' ) ) { return true ; } // We need to drop an existing default constraint if the column was // defined with a default value before and the native column type has changed. return $ columnDiff -> hasChanged ( 'type' ) || $ columnDiff -> hasChanged ( 'fixed' ) ; }
Checks whether a column alteration requires dropping its default constraint first.

Different to other database vendors SQL Server implements column default values
as constraints and therefore changes in a column's default value as well as changes
in a column's type require dropping the default constraint first before being to
alter the particular column to the new definition.

@param ColumnDiff $columnDiff The column diff to evaluate.

@return bool True if the column alteration requires dropping its default constraint first, false otherwise.
Checks whether a column alteration requires dropping its default constraint first .