运行一个空白项目。我现在在我的composer.json里有这个
"require": {
"php": ">=8.1",
"doctrine/doctrine-bundle": "^2.7",
"doctrine/migrations": "^3.5",
"doctrine/orm": "^2.13",
"test/framework-bundle": "^6.1@dev", //my fork of framework-bundle latest.
"symfony/runtime": "^6.1"
},当我运行./vendor/bin/doctrine-migrations时,我看到以下命令:
migrations
migrations:current [current] Outputs the current version
migrations:dump-schema [dump-schema] Dump the schema for your database to a migration.
migrations:execute [execute] Execute one or more migration versions up or down manually.
migrations:generate [generate] Generate a blank migration class.
migrations:latest [latest] Outputs the latest version
migrations:list [list-migrations] Display a list of all available migrations and their status.
migrations:migrate [migrate] Execute a migration to a specified version or the latest available version.
migrations:rollup [rollup] Rollup migrations by deleting all tracked versions and insert the one version that exists.
migrations:status [status] View the status of a set of migrations.
migrations:sync-metadata-storage [sync-metadata-storage] Ensures that the metadata storage is at the latest version.
migrations:up-to-date [up-to-date] Tells you if your schema is up-to-date.
migrations:version没有diff。另外,当我尝试运行diff时,它说没有定义该命令。有人知道问题出在哪里吗?
发布于 2022-08-23 07:08:14
我想你需要php bin/console doctrine:migrations:diff
diff:通过将当前数据库与映射信息进行比较来生成迁移。
您可以在https://symfony.com/bundles/DoctrineMigrationsBundle/current/index.html#usage中查看更多内容。
https://stackoverflow.com/questions/73443780
复制相似问题