I am new to Symfony+Doctrine, but fairly experienced with web application development in general (mostly using Zend Framework). I have started a new project using Symfony, and I'm loving it.
I've got a handful of fixtures in my /data/fixtures/ folder which get loaded whenever I update the schema and do a:
sf doctrine:build --all --and-load
The problem is, adding fixtures is really tedious, whereas my app interface is pretty quick to load data with. So, I load testing data into the database (using my app), but then whenever I make a change to the schema (and run the above statement), it reverts the data to just what's in the fixtures.
In the manual I read that the --and-append option would not overwrite the data in the database. But, the --all option says it resets the database.
Obviously if I delete a column from the schema then I would lose that information, but I just want to preserve my new records.
Sorry if I'm missing something very obvious. Thanks in advance for any help you can provide!
Use symfony doctrine:build --all-classes
From the documentation (symfony help doctrine:build
):
You can also generate only class files by using the --all-classes shortcut
option. When this option is used alone, the database will not be modified.
./symfony doctrine:build --all-classes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With