<?php

use yii\db\Migration;

/**
 * Class m210924_220452_add_permission_trainer
 */
class m210924_220452_add_permission_trainer extends Migration
{


    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $am = Yii::$app->authManager;
        $role = $am->createRole("trainer");
        $am->add($role);
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        echo "m210924_220452_add_permission_trainer cannot be reverted.\n";

        return false;
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m210924_220452_add_permission_trainer cannot be reverted.\n";

        return false;
    }
    */
}
