Просмотр файла database/upgrades/20170217112314_delete_nickname_in_users.php

Размер файла: 573B
<?php

use Phinx\Migration\AbstractMigration;

class DeleteNicknameInUsers extends AbstractMigration
{
    /**
     * Migrate Up.
     */
    public function up()
    {
        $table = $this->table('users');
        $table->removeColumn('nickname')
            ->removeIndex('nickname')
            ->save();
    }

    /**
     * Migrate Down.
     */
    public function down()
    {
        $table = $this->table('users');
        $table->addColumn('nickname', 'string', ['limit' => 20, 'null' => true])
            ->addIndex('nickname')
            ->save();
    }
}