View file upgrade/migrations/20161212003112_rename_indexes_in_error.php

File size: 605B
<?php

use Phinx\Migration\AbstractMigration;

class RenameIndexesInError extends AbstractMigration
{
    /**
     * Migrate Up.
     */
    public function up()
    {
        $table = $this->table('error');
        $table->removeIndexByName('error_num');
        $table->addIndex(['num', 'time'], ['name' => 'num_time'])
            ->save();
    }

    /**
     * Migrate Down.
     */
    public function down()
    {
        $table = $this->table('error');
        $table->removeIndexByName('num_time');
        $table->addIndex(['num', 'time'], ['name' => 'error_num'])
            ->save();
    }
}