theZorb
9/17/2018 - 5:55 PM

Remover coluna

Exemplo de como deletar colunas com o Phinx

public function up()
{
    $tabela = $this->table( 'nome_tabela' );
    $tabela->removeColumn( 'nome_coluna' )->update();
}

public function down()
{
    $tabela = $this->table( 'nome_tabela' );
    $tabela->addColumn( 'nome_coluna', 'integer', [
        'null' => true,
        'default' => null,
        'comment' => 'Comentário explicativo qualquer'
    ] )->update();
}