rahul
rahul

Reputation: 1473

Doctrine Column not found: 1054 Unknown column 's.features' in 'field list''

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.

Upvotes: 8

Views: 7339

Answers (2)

ridcully
ridcully

Reputation: 294

Do you checked the generated Base Table Classes ? Should be BaseSite.class.php

./doctrine build-all

should fix the Problem.

Upvotes: 1

morteza kavakebi
morteza kavakebi

Reputation: 1680

check this command out
goto doctrine directory
there must be bin/ and Doctrine/ directories there

php bin/doctrine orm:generate-proxies

Upvotes: 0

Related Questions