Is it possible to run the task quot;symfony doctrine build --allquot; on only one table?(是否可以运行任务“symfony dictionary build --all?只有一张桌子?)
问题描述
如果我运行以下任务,它会构建所有内容并清除数据库:
If I run the folowing task, it builds everything and wipes out the database:
php symfony doctrine build --all
我希望这个任务只为我放入 schema.yml 的新表运行
I would like this task to run only for the new table that I've put in schema.yml
有可能吗?
推荐答案
我认为你应该为此使用迁移.
I think you should use migration for that.
首先,您需要恢复初始状态(当模式、模型和数据库同步时).从 schema.yml 中删除您的更改,重建您的模型 php symfony 学说:build --all-classes
并导入原始数据库.
First, you need to restore the initial state (when schema, model and db are in sync). Remove your changes form schema.yml rebuild your model php symfony doctrine:build --all-classes
and import the original database.
然后在 schema.yml 中进行更改并运行以下命令:
After that make your changes in schema.yml and run these commands:
php symfony doctrine:generate-migrations-diff
php symfony doctrine:migrate
php symfony doctrine:build --all-classes
这篇关于是否可以运行任务“symfony dictionary build --all"?只有一张桌子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:是否可以运行任务“symfony dictionary build --all"?只有一张桌子?


基础教程推荐
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- 如何替换eregi() 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01