Is it possible to create a fixtures yml file for a certain model from the data already stored in the database (e.g开发者_高级运维. like dump-data
CLI but with specifying which data)?
When loading fixtures, you explicitly declare the models in the fixture file so this is the only way to do it, as far as I know.
If you're referring to loading fixtures into a database with existing data, loading fixtures for a specific model should not affect data in other tables, as long as you don't re-build the models. I haven't tested this though, so please do try it out in a safe environment first.
Another thing to bear in mind is that the data you upload as fixtures need to respect any foreign-key constraints you may have in your database.
精彩评论