Migration aware module extension for Yii2.

Installs: 53 443

Dependents: 1

Suggesters: 0

Security: 0

Stars: 4

Watchers: 2

Forks: 5

Open Issues: 0


V1.0.3 2018-01-18 08:39 UTC

This package is auto-updated.

Last update: 2024-06-21 03:45:57 UTC



Yii2 extension that allows modules to store migrations in their own folders and make them available for yii/migrate command


The preferred way to install this extension is through composer.

Either run

php composer.phar require "indigerd/yii2-migration-aware-module" "*"

or add

"indigerd/yii2-migration-aware-module" : "*"

to the require section of your application's composer.json file.


In your console config file in your migration section replace with class property and add configFiles array property. configFiles is array of configs where component will scan for your migration aware modules. By default configFiles contains backend and frontend configs from advanced application template. For example:

            'class' => 'indigerd\migrationaware\controllers\MigrateController',
            'configFiles' => [
            'migrationPath'=>'@common/migrations/db', //leave as it was before
            'migrationTable'=>'{{%system_db_migration}}' //leave as it was before

In your modules that have migrations your need either to implement indigerd\migrationaware\MigrationAwareInterface or to extend from indigerd\migrationaware\MigrationAwareModule. If you will implement interface you should implement method getMigrationPath and return in it folder which contains your module migrations. For example:

    public function getMigrationPath()
        return __DIR__.'/migrations';


yii2-migration-aware-module is released under the MIT License. See the bundled LICENSE file for details.