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

邮差的信 提交于 2019-12-08 17:24:56

问题


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.


回答1:


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

./doctrine build-all

should fix the Problem.




回答2:


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

php bin/doctrine orm:generate-proxies


来源:https://stackoverflow.com/questions/3262223/doctrine-column-not-found-1054-unknown-column-s-features-in-field-list

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!