Answer the question
In order to leave comments, you need to log in
Where can I find RBAC migrations for mongoDB?
All guides refer to RBAC migrations for mysql.
There is an authManager - yii\mongodb\rbac\MongoDbManager
Accordingly, it needs the same RBAC tables as for yii\rbac\DbManager
I dug through the folders and again found migrations only for mysql
Are there already created migrations for mongoDB or will I have to write it myself ?
If there are, where can they be found?
Answer the question
In order to leave comments, you need to log in
Abstract Class yii\mongodb\Migration
class m160719_140557_dialogs extends \yii\mongodb\Migration
{
public function init()
{
$this->db = Yii::$app->mongodb;
parent::init();
}
public function up()
{
$this->createCollection('dialogs',['users_id' => [],'settings' => []]);
$this->createIndex('dialogs',['users_id']);
}
public function down()
{
$this->dropCollection('dialogs',['users_id' => [],'settings' => []]);
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question