champs-libres/composer-bundle-migration

将DoctrineMigrations文件从已安装的包移动到根包。

2.0.0 2020-07-31 13:50 UTC

This package is auto-updated.

Last update: 2024-08-29 03:36:42 UTC


README

将Doctrine迁移文件从已安装的包迁移到根包。

安装

在您的根包中

composer require champs-libres/composer-bundle-migration ~1.0

在您的根composer.json中添加post-install-cmd和post-update-cmd

"scripts": {
        "post-install-cmd": [
            "ComposerBundleMigration\\Composer\\Migrations::synchronizeMigrations"
        ],
        "post-update-cmd": [
            "ComposerBundleMigration\\Composer\\Migrations::synchronizeMigrations"
        ]      
    }

配置迁移目录

在您的根包中,您可以配置迁移文件复制的目录。

composer.json

"extra": {
    "appMigrationsDir": "path/to/my/dir"
}

默认为app/DoctrineMigrations(doctrine-migrations-bundle的默认值)。

配置迁移源目录

在已安装的包中,您还可以配置迁移文件所在的目录。

"extra": {
    "migration-source": "path/to/my/source/folder"
}

默认为Resources/migrations