是否可以运行任务“;symfony学说的构建;只有一张桌子


Is it possible to run the task "symfony doctrine build --all" on only one table?

如果我运行以下任务,它会构建所有内容并清除数据库:

php symfony doctrine build --all

我希望这个任务只为我在schema.yml 中放入的新表运行

有可能吗?

我认为应该使用迁移。

首先,您需要恢复初始状态(当模式、模型和数据库同步时)。从schema.yml中删除更改,重建模型php symfony doctrine:build --all-classes并导入原始数据库。

之后,在schema.yml中进行更改并运行以下命令:

php symfony doctrine:generate-migrations-diff
php symfony doctrine:migrate
php symfony doctrine:build --all-classes