如何在Doctrine中覆盖现有的实体?

3

我正在尝试运行Doctrine的实体命令:

./vendor/bin/doctrine orm:convert-mapping  --from-database annotation ./Models

第一次运行此命令以生成实体映射文件,然后我修改了数据库表并再次运行相同的命令,结果出现了以下错误:
In ExportException.php line 36:

  Attempting to overwrite an existing file 'D:\xampp\htdocs\docx\Models\Address.php'.


orm:convert-mapping [--filter FILTER] [-f|--force] [--from-database] [--extend [EXTEND]] [--num-spaces [NUM-SPACES]] [--namespace [NAMESPACE]] [--] <to-type> <dest-path>
1个回答

3
你需要使用开关 -f 或 --force 尝试这样做:
$ ./vendor/bin/doctrine orm:convert-mapping  --from-database --force annotation ./Models

然后重新生成实体


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接