Symfony 1.4 Doctrine 装置加载单个文件?
我有一个工作应用程序,我想添加一些固定装置,但实际上我想做的就是加载新的固定装置文件。
当我运行
php symfony doctrine:data-load
它是否重新输入数据库中已有的数据时。如果没有,我想我可以直接调用它,它只会添加自上次以来的新装置。
如果它确实再次输入所有数据,那么有没有办法隔离特定夹具文件上的数据加载?
I've got a working app and I want to add some fixtures but really all I want to do is load in the new fixture file.
When i run the
php symfony doctrine:data-load
Does it re-enter data that is already in the database. If not I assume I can just call this and it will only add new fixtures since last time.
If it does enter all data again then is there a way to isolate data load on a specific fixture file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在命令前添加字符串“help”即可获得详细说明:
With the string "help" befor the command you become a detailed description:
您可以做您想做的两件事 - 您需要创建一个新任务来执行此操作...这将加载到单独的装置文件中:
这会将固定文件附加到当前数据:
所以只需创建一个新任务 - 访问数据库连接并根据您想要执行的操作运行这些命令之一抱歉...也许我应该正确阅读手册...
您确实可以使用当前命令附加和/或使用特定文件。
再次为误导您而道歉...但想想 - 您现在已经学会了如何编写任务:-)
You can do both of the things you want - you will need to create a new task to do it though ...This will load in an individual fixtures file :
This will append the fixtures file to the current data :
So just create a new task - access the database connection and run one of these commands depending on what you want to doApologies ... perhaps I should read the manual properly ...
You can indeed use the current command to append and/or use a specific file.
Once again apologies for misleading you ... but just think - you have learned how to write tasks now :-)