Answer the question
In order to leave comments, you need to log in
How to correctly reflect the use of migration from vendor in VCS?
Good afternoon. The question is how to capture in eternity the fact that you applied the migration, but not your own, which you have in the form of a project code, but the one in the vendor yii2 folder of the framework (this folder is under .gitignore as usual). I see an option to transfer the migration from the vendor inside the project, but this is somehow crooked, because updating a third-party extension can also affect the migration (the extension has been updated, new tables are required, for example), and then I will have to manually transfer the changes, there may be more problems , intuitively feel that this is wrong.
And there is such a moment that by applying the migration from the vendor:
php yii migrate [email protected]/rbac/migrations/
Answer the question
In order to leave comments, you need to log in
In my opinion, you need to rewrite the migration controller (create your own and connect it in the config)
Here is an example for two databases, but there is an example of a config for a custom controller:
https://habrahabr.ru/post/279701/
Further, in the migrate action, you can add copying the file to the console/migrations folder for example and having them in the project regardless of changes in the vendor.
/**
* Class m170113_172800_add_subscribe_table.
*/
class m170113_172800_add_subscribe_table extends \backend\modules\subscribe\migrations\m170113_150000_subscribe
{
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question