Doctrine ORM:删除所有表而不删除数据库 [英] Doctrine ORM: drop all tables without dropping database

查看:385
本文介绍了Doctrine 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.

这篇关于Doctrine ORM:删除所有表而不删除数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆