<?php
/**
 * @copyright Copyright (C) 2015-2017 AIZAWA Hina
 * @license https://github.com/fetus-hina/stat.ink/blob/master/LICENSE MIT
 * @author AIZAWA Hina <hina@bouhime.com>
 */

use app\components\db\Migration;

class m171104_184800_gear2_splatnet extends Migration
{
    public function up()
    {
        $this->execute('ALTER TABLE {{gear2}} DROP CONSTRAINT gear2_splatnet_key');
        $this->createIndex('gear2_splatnet_key', 'gear2', ['type_id', 'splatnet'], true);
    }

    public function down()
    {
        $this->dropIndex('gear2_splatnet_key', 'gear2');
        $this->execute('ALTER TABLE {{gear2}} ADD CONSTRAINT gear2_splatnet_key UNIQUE (splatnet)');
    }
}

Change unique constraint of gear2 splatnet-id
Change unique constraint of gear2 splatnet-id

Signed-off-by: AIZAWA Hina <07c779d48779c322a7c5324109202f9012f7aebf@bouhime.com>
