This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

problem updating doctrine schema

Discussion relating to version 1.3.x and 1.4.x

problem updating doctrine schema

by KriZa » Thu Aug 14, 2014 11:02 am

Got a project coded by a former employee. Using Symfony 1.4 and doctrine. I try to update some MySQL tables, by adding some new columns. Problem is, if I run "symfony doctrine:build-schema" something is wrong with the schema. In origin, the tables have the columns "created_at" and "updated_at". But the original schema does'nt include these columns (Not even a single table!). When I run the command, then all the tables in the schema.yml contain the 2 columns. Problem is, I run into some tuple-update-errors (less an error, more a tough problem) afterwards.

My questions:
1. How to make the schema automatically without the 2 columns. I think I have read somewhere, that it is not neccessary to put them into the schema, symfony does auto update/set them.
2. May it be, that I run "symfony doctrine:build-model" afterwards? (Does this destroy/overwrite existing and modified Tableclasses in lib/model/doctrine? That would be bad.)
3. Is there a "how to" to update tables as simple as possible without touching any modified files?

Thanks alot!
Junior Member
Posts: 2
Joined: Thu Aug 14, 2014 10:36 am

Re: problem updating doctrine schema

by white-bear » Sun Sep 07, 2014 1:01 pm

you got this two columns due to the paramter "actAs: [Timestampable]" in you yml schema - you need to remove it, run "doctrine:build --all --and-load --no-confirmation" on your DB. update the project files on the sever and it should be ok. ;)
Junior Member
Posts: 2
Joined: Sun Sep 07, 2014 11:07 am