Is it possible to load doctrine fixtures without deleting database

user1994660 picture user1994660 · Mar 5, 2014 · Viewed 18k times · Source

I have defined some fixtures in doctrine.

When i try to run using this

php app/console doctrine:fixtures:load then it asks me to purge the database.

is it possible to load it without purging database.

I remeber Django has fixtures which can be loaded in separate tables without purging existing database

Answer

Phil picture Phil · Mar 5, 2014

Use the --append option

php app/console help doctrine:fixtures:load
Usage:
 doctrine:fixtures:load [--fixtures[="..."]] [--append] [--em="..."] [--purge-with-truncate]

Options:
 --fixtures             The directory or file to load data fixtures from. (multiple values allowed)
 --append               Append the data fixtures instead of deleting all data from the database first.
 --em                   The entity manager to use for this command.
 --purge-with-truncate  Purge data by using a database-level TRUNCATE statement