views:

41

answers:

2

I added a new column "features" to the site table and regenerated the models using Doctrine This code is causing an error

 $siteTable = Doctrine_Core::getTable("Site");
 $site = $siteTable->findOneByName("site");  // this line is throwing an exception

Exception : Unknown column "s.features" in field list.....

I checked the database and it contains the field, I also checked the Site model and the table definition contains the column information. The primary key of all tables is 'id'. Also in the line which throws the exception I am not using the newly added column. If I remove the column from the table definition of the site object then the above code works.....

This error is happening to any table when I add a new column and regenerate the models from it

A: 

Have you checked the database has the column? Sounds like you haven't rebuilt the database.

johnwards
yes the column is present in the table
rahul
A: 

Could your post your model (schema.yml for instance) and your SQL DB schema?

javi