symfony doctrine data-dump and reload wont't work
I have a database built by Doctrine from schema.yml which I want to modify. Thus, first I saved the data using doctrine:data-dump command. Afterwards I wanted to check if it real开发者_JS百科ly can reload data, so I called the doctrine:build --all --and-load command.
It successfully rebuilt the database, however when loading data from data1.yml file(where I saved beforehand) it gives me the following error:
Couldn't call Doctrine_Core::set(), second argument should be an instance of Doctrine_Collection when setting one-to-many references.
I would really appreciate if you guys could help me fix this problem.
Well, it's not really possible to dump the database with data-dump and load it later with data-load without any additional steps (talking about more complicated schemas). You need to manually modify your fixtures a bit.
The reason is those tools were not made with such scenario in mind.
The right approach with changing schema is to use doctrine migrations.
精彩评论