Просмотр файла upgrade/migrations/20161211235733_rename_indexes_in_counter31.php

Размер файла: 611B
<?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();
    }
}