Hi, Doctrine (on Ubuntu): What command generate models from database without delete existing models?(I add new tables soo i want update models) Thanks
views:
342answers:
1
+1
A:
If you're using Doctrine 1, you'll need to make use of Migrations. Migrations can either be written manually, or auto-generated one of a few different commands:
./doctrine generate-migration
./doctrine generate-migrations-db
./doctrine generate-migrations-models
Migrations can be a fairly complex topic, so I would read up on the documentation. You may also want to check out this slide show.
If you're using Doctrine 2, things get a little simpler. It doesn't have a Migrations class (yet), but there an easy-to-use command to non-destructively update your db schema:
./doctrine orm:schema-tool:update
This has worked well for me, but can sometimes fail due to complex foreign key constraints.
Bryan M.
2010-05-24 22:02:08
Thank you very much!
Yosef
2010-05-27 09:58:55
No problem. Please remember to mark the question as answered if it solved your problem.
Bryan M.
2010-05-27 13:37:48