<?php

use yii\db\Schema;
use yii\db\Migration;

class m150919_181709_add_basic_roles extends Migration
{
    public function up()
    {
    	$role = Yii::$app->authManager->createRole('developer');
    	Yii::$app->authManager->add($role);
    	
    	$role = Yii::$app->authManager->createRole('admin');
    	Yii::$app->authManager->add($role);
    	

    	$role = Yii::$app->authManager->createRole('group_admin');
    	Yii::$app->authManager->add($role);
    	
    	$role = Yii::$app->authManager->createRole('shop_admin');
    	Yii::$app->authManager->add($role);
    	
    	$role = Yii::$app->authManager->createRole('receptionist');
    	Yii::$app->authManager->add($role);
    }

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

        return false;
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}
