yiisolutions / yii2-migrations-advanced
Advanced migrations for Yii2
Installs: 26
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: ~2.0.5
This package is not auto-updated.
Last update: 2024-11-09 20:50:56 UTC
README
Advanced migrations for Yii2
Installation
Use composer
composer require "yiisolutions/yii2-migrations-advanced: @dev"
or add to composer.json
require section:
"yiisolutions/yii2-migrations-advanced": "@dev"
Usage
Add custom migrate command in config/console.php
file:
<?php return [ // ... 'controllerMap' => [ 'migrate' => [ 'class' => 'yiisolutions\migrations\commands\MigrateController', // your config options here ... ], ], // ... ];
RBAC migrations
Sometimes you need to create a migration for RBAC. Use RbacMigrateController for this:
<?php return [ // ... 'controllerMap' => [ 'rbac-migrate' => [ 'class' => 'yiisolutions\migrations\commands\RbacMigrateController', ], ], // ... ];
For rbac-migrate/create
command available templates:
create_[name]_role
- create new role migration (options: description, ruleName)drop_[name]_role
- drop exist role migrationcreate_[name]_permission
- create new permission migration (options: description, ruleName)drop_[name]_permission
- drop exist permission migration.