protected function copyTable( $table, $tempTable = '', array $exclude = [ ] )
    {
        $query = "ALTER TABLE $table RENAME TO $tempTable";

        $result = $this->modify( $query );

        if ( FALSE === $result )
        {
            throw new DatabaseException( 'Drop column failed' );
        }

        $columns = $this->getTableColumns( $tempTable, $exclude );

        // create table
        $this->createTable( $table, $columns );

        $this->copyTableData( $table, $tempTable, $columns );
    }
protected function copyTable( $table, $tempTable = '', array $exclude = [ ] )
    {
        $query = "ALTER TABLE $table RENAME TO $tempTable";

        $result = $this->modify( $query );

        if ( FALSE === $result )
        {
            throw new DatabaseException( 'Drop column failed' );
        }

        $columns = $this->getTableColumns( $tempTable, $exclude );

        // create table
        $this->createTable( $table, $columns );

        $this->copyTableData( $table, $tempTable, $columns );
    }
protected function copyTable ( $ table , $ tempTable = '' , array $ exclude = [ ] ) { $ query = "ALTER TABLE $table RENAME TO $tempTable" ; $ result = $ this -> modify ( $ query ) ; if ( FALSE === $ result ) { throw new DatabaseException ( 'Drop column failed' ) ; } $ columns = $ this -> getTableColumns ( $ tempTable , $ exclude ) ; // create table
 $ this -> createTable ( $ table , $ columns ) ; $ this -> copyTableData ( $ table , $ tempTable , $ columns ) ; }
Copy a table.

@param string $table     the table to copy
@param string $tempTable temporary table name
@param array  $exclude   columns to exclude

@throws DatabaseException
Copy a table .