lib/Doctrine/DBAL/Platforms/DB2Platform.php
private function getAlterColumnClausesSQL(ColumnDiff $columnDiff)
    {
        $column = $columnDiff->column->toArray();

        $alterClause = 'ALTER COLUMN ' . $columnDiff->column->getQuotedName($this);

        if ($column['columnDefinition']) {
            return [$alterClause . ' ' . $column['columnDefinition']];
        }

        $clauses = [];

        if ($columnDiff->hasChanged('type') ||
            $columnDiff->hasChanged('length') ||
            $columnDiff->hasChanged('precision') ||
            $columnDiff->hasChanged('scale') ||
            $columnDiff->hasChanged('fixed')
        ) {
            $clauses[] = $alterClause . ' SET DATA TYPE ' . $column['type']->getSQLDeclaration($column, $this);
        }

        if ($columnDiff->hasChanged('notnull')) {
            $clauses[] = $column['notnull'] ? $alterClause . ' SET NOT NULL' : $alterClause . ' DROP NOT NULL';
        }

        if ($columnDiff->hasChanged('default')) {
            if (isset($column['default'])) {
                $defaultClause = $this->getDefaultValueDeclarationSQL($column);

                if ($defaultClause) {
                    $clauses[] = $alterClause . ' SET' . $defaultClause;
                }
            } else {
                $clauses[] = $alterClause . ' DROP DEFAULT';
            }
        }

        return $clauses;
    }
private function getAlterColumnClausesSQL(ColumnDiff $columnDiff)
    {
        $column = $columnDiff->column->toArray();

        $alterClause = 'ALTER COLUMN ' . $columnDiff->column->getQuotedName($this);

        if ($column['columnDefinition']) {
            return [$alterClause . ' ' . $column['columnDefinition']];
        }

        $clauses = [];

        if ($columnDiff->hasChanged('type') ||
            $columnDiff->hasChanged('length') ||
            $columnDiff->hasChanged('precision') ||
            $columnDiff->hasChanged('scale') ||
            $columnDiff->hasChanged('fixed')
        ) {
            $clauses[] = $alterClause . ' SET DATA TYPE ' . $column['type']->getSQLDeclaration($column, $this);
        }

        if ($columnDiff->hasChanged('notnull')) {
            $clauses[] = $column['notnull'] ? $alterClause . ' SET NOT NULL' : $alterClause . ' DROP NOT NULL';
        }

        if ($columnDiff->hasChanged('default')) {
            if (isset($column['default'])) {
                $defaultClause = $this->getDefaultValueDeclarationSQL($column);

                if ($defaultClause) {
                    $clauses[] = $alterClause . ' SET' . $defaultClause;
                }
            } else {
                $clauses[] = $alterClause . ' DROP DEFAULT';
            }
        }

        return $clauses;
    }
private function getAlterColumnClausesSQL ( ColumnDiff $ columnDiff ) { $ column = $ columnDiff -> column -> toArray ( ) ; $ alterClause = 'ALTER COLUMN ' . $ columnDiff -> column -> getQuotedName ( $ this ) ; if ( $ column [ 'columnDefinition' ] ) { return [ $ alterClause . ' ' . $ column [ 'columnDefinition' ] ] ; } $ clauses = [ ] ; if ( $ columnDiff -> hasChanged ( 'type' ) || $ columnDiff -> hasChanged ( 'length' ) || $ columnDiff -> hasChanged ( 'precision' ) || $ columnDiff -> hasChanged ( 'scale' ) || $ columnDiff -> hasChanged ( 'fixed' ) ) { $ clauses [ ] = $ alterClause . ' SET DATA TYPE ' . $ column [ 'type' ] -> getSQLDeclaration ( $ column , $ this ) ; } if ( $ columnDiff -> hasChanged ( 'notnull' ) ) { $ clauses [ ] = $ column [ 'notnull' ] ? $ alterClause . ' SET NOT NULL' : $ alterClause . ' DROP NOT NULL' ; } if ( $ columnDiff -> hasChanged ( 'default' ) ) { if ( isset ( $ column [ 'default' ] ) ) { $ defaultClause = $ this -> getDefaultValueDeclarationSQL ( $ column ) ; if ( $ defaultClause ) { $ clauses [ ] = $ alterClause . ' SET' . $ defaultClause ; } } else { $ clauses [ ] = $ alterClause . ' DROP DEFAULT' ; } } return $ clauses ; }
Returns the ALTER COLUMN SQL clauses for altering a column described by the given column diff.

@param ColumnDiff $columnDiff The column diff to evaluate.

@return string[]
Returns the ALTER COLUMN SQL clauses for altering a column described by the given column diff .