Extensions, Migrations Etc

Hi all. I’ve got a question.

Let’s suppose I want to split my code into many small modules (or packages) in order to host them on my own “packagist” repo (like satis), and then create new apps in two or three simple steps:

  • composer create-project

  • edit composer.json, add required modules

  • composer install (or composer require …)

My question is about migrations.

  1. Is there any way to run them automatically, right after package installation?

  2. If package code changes and new migrations must be applied, is there any way to run ALL new migrations from all packages?

I mean, I can do it this way:

./yii migrate --migrationPath=@vendorName/packageName1/migrations

./yii migrate --migrationPath=@vendorName/packageName2/migrations

./yii migrate --migrationPath=@vendorName/packageName100/migrations

but this looks boring.