src/Database/Migration/Generator/MySqlGenerator.php
protected function getColumnCreateId($schema, $table, $columnName)
    {
        $result = $this->getColumnCreate($schema, $table, $columnName);
        $output = [];
        $output[] = sprintf("%sif (\$this->table('%s')->hasColumn('%s')) {", $this->ind2, $result[0], $result[1]);
        $output[] = sprintf("%s\$this->table(\"%s\")->changeColumn('%s', '%s', %s)->update();", $this->ind3, $result[0],
            $result[1], $result[2], $result[3]);
        $output[] = sprintf("%s} else {", $this->ind2);
        $output[] = sprintf("%s\$this->table(\"%s\")->addColumn('%s', '%s', %s)->update();", $this->ind3, $result[0],
            $result[1], $result[2], $result[3]);
        $output[] = sprintf("%s}", $this->ind2);

        return implode($this->nl, $output);
    }
protected function getColumnCreateId($schema, $table, $columnName)
    {
        $result = $this->getColumnCreate($schema, $table, $columnName);
        $output = [];
        $output[] = sprintf("%sif (\$this->table('%s')->hasColumn('%s')) {", $this->ind2, $result[0], $result[1]);
        $output[] = sprintf("%s\$this->table(\"%s\")->changeColumn('%s', '%s', %s)->update();", $this->ind3, $result[0],
            $result[1], $result[2], $result[3]);
        $output[] = sprintf("%s} else {", $this->ind2);
        $output[] = sprintf("%s\$this->table(\"%s\")->addColumn('%s', '%s', %s)->update();", $this->ind3, $result[0],
            $result[1], $result[2], $result[3]);
        $output[] = sprintf("%s}", $this->ind2);

        return implode($this->nl, $output);
    }
protected function getColumnCreateId ( $ schema , $ table , $ columnName ) { $ result = $ this -> getColumnCreate ( $ schema , $ table , $ columnName ) ; $ output = [ ] ; $ output [ ] = sprintf ( "%sif (\$this->table('%s')->hasColumn('%s')) {" , $ this -> ind2 , $ result [ 0 ] , $ result [ 1 ] ) ; $ output [ ] = sprintf ( "%s\$this->table(\"%s\")->changeColumn('%s', '%s', %s)->update();" , $ this -> ind3 , $ result [ 0 ] , $ result [ 1 ] , $ result [ 2 ] , $ result [ 3 ] ) ; $ output [ ] = sprintf ( "%s} else {" , $ this -> ind2 ) ; $ output [ ] = sprintf ( "%s\$this->table(\"%s\")->addColumn('%s', '%s', %s)->update();" , $ this -> ind3 , $ result [ 0 ] , $ result [ 1 ] , $ result [ 2 ] , $ result [ 3 ] ) ; $ output [ ] = sprintf ( "%s}" , $ this -> ind2 ) ; return implode ( $ this -> nl , $ output ) ; }
Get primary key column update commands.

@param array  $schema
@param string $table
@param string $columnName

@return string
Get primary key column update commands .