如何更改config.yml中的默认迁移目录?现在我使用2个不同数据库连接的捆绑包,我想创建迁移文件并将它们存储在不同的目录中以使用该教义:迁移:migrate --em =捆绑包的依赖性中的任何函数.
例如:
doctrine:migrate:diff --em=whatever #creating a version file in the DoctrineMigrationsWhatever directory
php app/console doctrine:migrations:status --em=whatever # shows only the version files, that belong to the bundle
Run Code Online (Sandbox Code Playgroud) 我想使用学说迁移生成数据库迁移脚本。
我的一个客户有 mysql 数据库,另一个有 mssql,我们在我们的开发环境中使用 sqlite。
如果我使用 生成脚本php artisan doctrine:migrations:diff,那么它将从这一行开始:
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
Run Code Online (Sandbox Code Playgroud)
如何从实体类中的更改以某种方式生成迁移脚本,使其也可以在 mysql、sqlsrv 和 sqlite 上使用?