How can I add a column to a Database table without overwriting the classes already generated? (Doctrine) What files do I have to edit?
If I simply add the column in the database, I can’t use the set and get functions of Doctrine ORM.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use doctrine migrations. It allows you to modify your schema, update the database and your model without also losing the existing data in your database (in case it is relevant).
http://www.symfony-project.org/doctrine/1_2/en/07-Migrations
Applicable for symfony 1.4 too