webtoucher/yii2-migrate

Yii 2 extension for creating and running migrations

Installs: 5 146

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 2

Type:yii-extension

v1.0.1 2014-07-25 10:19 UTC

This package is auto-updated.

Last update: 2024-11-14 21:36:57 UTC


README

Console Migration Command with multiple paths/aliases support.

Installation

The preferred way to install this extension is through composer.

Either run

$ php composer.phar require webtoucher/yii2-migrate "*"

or add

"webtoucher/yii2-migrate": "*"

to the require section of your composer.json file.

Add the following in your console config:

return [
    ...
    'controllerMap' => [
        ...
        'migrate' => [
            'class' => 'webtoucher\migrate\controllers\MigrateController',
            // alias of modules directory
            // 'modulesPath' => '@app/modules',
            // additional aliases of migration directories
            // 'migrationLookup' => [],
        ],
        ...
    ],
    ...
];

Usage

To create migration in common directory @app/migration use follow command:

$ php yii migrate/create comment_for_migration

To create migration in directory of the module @app/modules/module_name/migration use follow command:

$ php yii migrate/create comment_for_migration module_name

To run all migration from common directory and from directories of the modules use follow command:

$ php yii migrate