src/Phinx/Db/Adapter/SQLiteAdapter.php
protected function beginAlterByCopyTable($tableName)
    {
        $instructions = new AlterInstructions();
        $instructions->addPostStep(function ($state) use ($tableName) {
            $createSQL = $this->getDeclaringSql($tableName);

            $tmpTableName = 'tmp_' . $tableName;
            $this->execute(
                sprintf(
                    'ALTER TABLE %s RENAME TO %s',
                    $this->quoteTableName($tableName),
                    $this->quoteTableName($tmpTableName)
                )
            );

            return compact('createSQL', 'tmpTableName') + $state;
        });

        return $instructions;
    }
protected function beginAlterByCopyTable($tableName)
    {
        $instructions = new AlterInstructions();
        $instructions->addPostStep(function ($state) use ($tableName) {
            $createSQL = $this->getDeclaringSql($tableName);

            $tmpTableName = 'tmp_' . $tableName;
            $this->execute(
                sprintf(
                    'ALTER TABLE %s RENAME TO %s',
                    $this->quoteTableName($tableName),
                    $this->quoteTableName($tmpTableName)
                )
            );

            return compact('createSQL', 'tmpTableName') + $state;
        });

        return $instructions;
    }
protected function beginAlterByCopyTable ( $ tableName ) { $ instructions = new AlterInstructions ( ) ; $ instructions -> addPostStep ( function ( $ state ) use ( $ tableName ) { $ createSQL = $ this -> getDeclaringSql ( $ tableName ) ; $ tmpTableName = 'tmp_' . $ tableName ; $ this -> execute ( sprintf ( 'ALTER TABLE %s RENAME TO %s' , $ this -> quoteTableName ( $ tableName ) , $ this -> quoteTableName ( $ tmpTableName ) ) ) ; return compact ( 'createSQL' , 'tmpTableName' ) + $ state ; } ) ; return $ instructions ; }
Returns the initial instructions to alter a table using the
rename-alter-copy strategy

@param string $tableName The table to modify
@return AlterInstructions
Returns the initial instructions to alter a table using the rename - alter - copy strategy