简体   繁体   English

Symfony插件“ sfLucene”从哪里获得有关我的数据库架构的信息?

[英]Where does the Symfony plugin 'sfLucene' get the information about my database schema from?

A month ago I adjusted my database schema. 一个月前,我调整了数据库架构。 I added a column called ordinal. 我添加了一个名为ordinal的列。

I rebuilt my model and uploaded my changes. 我重建了模型并上传了更改。

Everything works fine apart from my instance of sfLucene will not rebuild. 除了我的sfLucene实例不会重建之外,其他所有东西都工作正常。

I run 我跑

symfony lucene-rebuild frontend

But I get the error once it gets to the Model in question (others are fine): 但是一旦出现问题的模型,我就会得到错误(其他都可以):

propel exception: unknown column ORDINAL

I have tried clearing the Symfony cache but to no avail. 我曾尝试清除Symfony缓存,但无济于事。

I feel like Lucene has cached the database schema somewhere not sure where. 我觉得Lucene已将数据库架构缓存在某个不确定位置。

Index rebuilding works fine on my local PC. 索引重建可以在我的本地PC上正常运行。

Probably checks schema.yml or schema.xml 可能检查schema.yml或schema.xml

You can regenerate/update it with the console command 您可以使用console命令重新生成/更新它

symfony propel:build-schema

Older versions of symfony use this syntax 旧版本的symfony使用此语法

symfony propel-build-schema

Problem solved 问题解决了

The databases.yml file on the server had the all: setting pointed to my test server. 服务器上的databases.yml文件具有all:设置,该设置指向我的测试服务器。

Unfortunately, the test server is on the same box, therefore MySQL login was succeeding. 不幸的是,测试服务器在同一台机器上,因此MySQL登录成功。

However the test database did not have the recently added fields. 但是,测试数据库没有最近添加的字段。

The command line (ie the symfony lucene-rebuild command) uses the all: setting in the databases.yml 命令行(即symfony lucene-rebuild命令)使用database.yml中的all:设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM