2017 © Pedro Peláez
 

library yii2-automigrate

Easy way to run migrations in yii2 from different paths and databases

image

moein7tl/yii2-automigrate

Easy way to run migrations in yii2 from different paths and databases

  • Wednesday, April 12, 2017
  • by moein7tl
  • Repository
  • 1 Watchers
  • 1 Stars
  • 46 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Yii2 Auto Migrate Package

This package helps you to run migrations from different paths and databases in easier way., (*1)

Installation

php composer.phar require "moein7tl/yii2-automigrate:dev-master" 

or add following line to composer.json and run composer update, (*2)

"moein7tl/yii2-automigrate": "dev-master"

Configuration

Add following line to your console configuration file ( config/console.php ), (*3)

'controllerMap' => [
    'auto-migrate'      =>  [
        'class'     =>  moein7tl\autoMigrate\AutoMigrateController::className()
    ]
],

Create migrations.php in config folder with following structure:, (*4)

return [
    'mongodb'       =>  [
        // MongoDB migrations paths
        Yii::getAlias('@app').DIRECTORY_SEPARATOR.implode(DIRECTORY_SEPARATOR, ['modules', 'users', 'migrations', 'mongo']),
    ],
    'relational'    =>  [
        // Relational Database migrations paths
        Yii::getAlias('@yii').DIRECTORY_SEPARATOR.implode(DIRECTORY_SEPARATOR, ['rbac', 'migrations']),
        Yii::getAlias('@app').DIRECTORY_SEPARATOR.implode(DIRECTORY_SEPARATOR, ['modules', 'users', 'migrations', 'relational'])
    ]
];

Usage

To run and rollback migrations:, (*5)

php yii auto-migrate/up
php yii auto-migrate/down

The Versions

12/04 2017

dev-master

9999999-dev

Easy way to run migrations in yii2 from different paths and databases

  Sources   Download

MIT

The Requires

 

by Moein Hosseini Manesh

06/11 2016

v0.1

0.1.0.0

Easy way to run migrations in yii2 from different paths and databases

  Sources   Download

MIT

The Requires

 

by Moein Hosseini Manesh