本文介绍了原则 ORM:删除所有表而不删除数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我必须使用现有的数据库(不是用 Doctrine 管理的),并且我只想对这个数据库中的新表使用原则.
I have to work with an existing database (not managed with Doctrine) and I want to use doctrine only for new tables in this db.
有没有办法告诉 Doctrine 在重新加载时不要删除整个数据库,而只删除 yaml
文件中定义的模型?
is there a way to tell Doctrine to not drop the entire DB on reload but only the models defined in the yaml
file ?
推荐答案
我知道这是一个很老的问题,看来你正在使用 symfony.
I know this a very old question, and it appears you are using symfony.
试试:
app/console --env=prod doctrine:schema:drop --full-database
这将删除数据库中的所有表.
This will drop all the tables in the DB.
这篇关于原则 ORM:删除所有表而不删除数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!