dmstr/yii2-migrate-command Console Migration Command with multiple paths/aliases support

extensionmigrationconsolecommand

Extended Migration Command

DEPRECATION NOTICE - since Yii 2.0.12 this extension is obsolete, its functionality is now supported by the framework core. For details see also issue.


Latest Stable Version Total Downloads License

Console Migration Command with multiple paths/aliases support

This extension was created from this Pull Request on GitHub, which became unmergeable. Until this feature will be reimplemented into the core, you can use this extension if you need to handle multiple migration paths.

Note! If using dmstr/yii2-migrate-command in an existing project, you may have to remove your migration table, due to a schema change.

Installation

The preferred way to install this extension is through composer.

composer require dmstr/yii2-migrate-command

Usage

Configure the command in your main application configuration:

'controllerMap'       => [
    'migrate' => [
        'class' => 'dmstr\console\controllers\MigrateController'
    ],
],

Once the extension is installed and configured, simply use it on your command line

./yii migrate

Adding migrations via application configuration

Add additional migration paths via application params:

"yii.migrations"=> [
    "@dektrium/user/migrations",
],

Adding migrations via extension bootstrap()

You can also add migrations in your module bootstrap process:

public function bootstrap($app)
{
    $app->params['yii.migrations'][] = '@vendorname/packagename/migrations';
}

Adding migrations via command parameter

If you want to specify an additional path directly with the command, use

./yii migrate --migrationLookup=@somewhere/migrations/data1,@somewhere/migrations/data2

Note! Please make sure to not use spaces in the comma separated list.


Built by dmstr, Stuttgart

Changelog

CHANGELOG

dmstr/yii2-migrate-command

0.4.0-beta1

0.3.0

  • colorized output, code-formatting (@schmunk42)
  • sort history by apply_time first, then by version (@sblaut)
  • fix error opendir (@arswarog)
  • Fixed output of 'new' action (correct display of the migrations) (@omnilight)

0.2.0

  • fix param description
  • update docs
  • updated description
  • add option disableLookup
  • Fix for aliases in mark command (@omnilight)
  • addd migration lookup example

0.1.0

  • always display lookup directories, added bootstrapping instructions
  • fixed #2
  • fixed database connection display
  • display full path, not only alias
  • updated file checks
  • updated docs
  • initital commit, copied code from https://github.com/yiisoft/yii2/pull/3273/files

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



0.4.0-beta2 is the latest of 7 releases



BSD-3-Clause license
Stats
31 github stars & 15 github forks
191 downloads in the last day
2343 downloads in the last 30 days
266626 total downloads