src/Phinx/Db/Adapter/SqlServerAdapter.php
protected function getChangeDefault($tableName, Column $newColumn)
    {
        $constraintName = "DF_{$tableName}_{$newColumn->getName()}";
        $default = $newColumn->getDefault();
        $instructions = new AlterInstructions();

        if ($default === null) {
            $default = 'DEFAULT NULL';
        } else {
            $default = ltrim($this->getDefaultValueDefinition($default));
        }

        if (empty($default)) {
            return $instructions;
        }

        $instructions->addPostStep(sprintf(
            'ALTER TABLE %s ADD CONSTRAINT %s %s FOR %s',
            $this->quoteTableName($tableName),
            $constraintName,
            $default,
            $this->quoteColumnName($newColumn->getName())
        ));

        return $instructions;
    }
protected function getChangeDefault($tableName, Column $newColumn)
    {
        $constraintName = "DF_{$tableName}_{$newColumn->getName()}";
        $default = $newColumn->getDefault();
        $instructions = new AlterInstructions();

        if ($default === null) {
            $default = 'DEFAULT NULL';
        } else {
            $default = ltrim($this->getDefaultValueDefinition($default));
        }

        if (empty($default)) {
            return $instructions;
        }

        $instructions->addPostStep(sprintf(
            'ALTER TABLE %s ADD CONSTRAINT %s %s FOR %s',
            $this->quoteTableName($tableName),
            $constraintName,
            $default,
            $this->quoteColumnName($newColumn->getName())
        ));

        return $instructions;
    }
protected function getChangeDefault ( $ tableName , Column $ newColumn ) { $ constraintName = "DF_{$tableName}_{$newColumn->getName()}" ; $ default = $ newColumn -> getDefault ( ) ; $ instructions = new AlterInstructions ( ) ; if ( $ default === null ) { $ default = 'DEFAULT NULL' ; } else { $ default = ltrim ( $ this -> getDefaultValueDefinition ( $ default ) ) ; } if ( empty ( $ default ) ) { return $ instructions ; } $ instructions -> addPostStep ( sprintf ( 'ALTER TABLE %s ADD CONSTRAINT %s %s FOR %s' , $ this -> quoteTableName ( $ tableName ) , $ constraintName , $ default , $ this -> quoteColumnName ( $ newColumn -> getName ( ) ) ) ) ; return $ instructions ; }
Returns the instructions to change a column default value

@param string $tableName The table where the column is
@param Column $newColumn The column to alter
@return AlterInstructions
Returns the instructions to change a column default value