View file database/upgrades/20180420143632_edit_fields_in_offers.php

File size: 647B
<?php

use Phinx\Migration\AbstractMigration;

class EditFieldsInOffers extends AbstractMigration
{
    /**
     * Migrate Up.
     */
    public function up()
    {
        $table = $this->table('offers');
        $table
            ->changeColumn('rating', 'integer', ['default' => 0])
            ->changeColumn('count_comments', 'integer', ['default' => 0])
            ->changeColumn('updated_at', 'integer', ['null' => true])
            ->save();

        $table
            ->removeIndex('rating')
            ->addIndex('rating')
            ->save();
    }

    /**
     * Migrate Down.
     */
    public function down()
    {

    }
}