Symfony doctrine/migrations: diff 不存在
P粉548512637
P粉548512637 2023-08-26 21:29:29
[PHP讨论组]
<p>运行一个空项目。我目前在我的composer.json文件中有以下内容:</p> <pre class="brush:php;toolbar:false;">&quot;require&quot;: { &quot;php&quot;: &quot;&gt;=8.1&quot;, &quot;doctrine/doctrine-bundle&quot;: &quot;^2.7&quot;, &quot;doctrine/migrations&quot;: &quot;^3.5&quot;, &quot;doctrine/orm&quot;: &quot;^2.13&quot;, &quot;test/framework-bundle&quot;: &quot;^6.1@dev&quot;, //我的最新的framework-bundle分支。 &quot;symfony/runtime&quot;: &quot;^6.1&quot; },</pre> <p>当我运行<code>./vendor/bin/doctrine-migrations</code>时,我看到以下命令:</p> <pre class="brush:php;toolbar:false;">migrations migrations:current [current] 输出当前版本 migrations:dump-schema [dump-schema] 将数据库架构转储到迁移中。 migrations:execute [execute] 手动执行一个或多个迁移版本。 migrations:generate [generate] 生成一个空的迁移类。 migrations:latest [latest] 输出最新版本 migrations:list [list-migrations] 显示所有可用迁移及其状态的列表。 migrations:migrate [migrate] 执行到指定版本或最新可用版本的迁移。 migrations:rollup [rollup] 通过删除所有已跟踪的版本并插入一个存在的版本来合并迁移。 migrations:status [status] 查看一组迁移的状态。 migrations:sync-metadata-storage [sync-metadata-storage] 确保元数据存储处于最新版本。 migrations:up-to-date [up-to-date] 告诉您您的架构是否是最新的。 migrations:version</pre> <p>没有<code>diff</code>命令。当我尝试运行<code>diff</code>时,它显示该命令未定义。有人知道问题是什么吗?</p>
P粉548512637
P粉548512637

全部回复(1)
P粉077701708

我认为你需要 php bin/console doctrine:migrations:diff
diff: 通过比较当前数据库和映射信息来生成迁移。

你可以在 https://symfony.com/bundles/DoctrineMigrationsBundle/current/index.html#usage 查看更多信息。

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号