View file upgrade/migrations/20161211235733_rename_indexes_in_counter31.php
<?php use Phinx\Migration\AbstractMigration; class RenameIndexesInCounter31 extends AbstractMigration { /** * Migrate Up. */ public function up() { $table = $this->table('counter31'); $table->removeIndexByName('count_days'); $table->addIndex('days', ['unique' => true]) ->save(); } /** * Migrate Down. */ public function down() { $table = $this->table('counter31'); $table->removeIndexByName('days'); $table->addIndex('days', ['unique' => true, 'name' => 'count_days']) ->save(); } }