Heroku - 没有记录的索引 table 失败

Heroku - indexed table with no record fails

我在 rails 上有一个 ruby 应用程序正在开发中,它包含一个 sqlite3 数据库。在应用程序中 tables 的早期开发 none 中有被索引的字段(除了始终被索引的 ID)并且在部署到 Heroku 后,应用程序可以找到。

然后我更改了 table 中的三个,这样每个字段(除了被索引的 ID 之外)都被索引为唯一的,我还有一个 table 没有有一个索引字段而不是 ID。即使 tables 中没有记录,应用程序在开发中也能正常工作,但是当使用 postgres 将应用程序推送到 Heroku 时,应用程序在每个索引的 tables 上失败,尽管在 un 上没有-索引一个。
加载应用程序时没有错误消息,我运行"heroku run rake db:migrate"时也没有错误。

日志中的错误消息是 "PG::UndefinedTable: ERROR: relation "[tablename]“不存在”,看起来 table 不存在。有没有人知道我如何找到问题和/或解决问题?

我试过在本地完全删除和重建数据库,多次删除Heroku上的应用程序和数据库并重新部署,无济于事。

我真是无计可施!如有任何帮助,我们将不胜感激!

提前致谢,

您混合使用带引号和不带引号的标识符,这可能是在开发中使用 MySQL 而在生产中使用 PostreSQL 的副作用。

作为 docs 状态...

Quoting an identifier also makes it case-sensitive, whereas unquoted names are always folded to lower case. For example, the identifiers FOO, foo, and "foo" are considered the same by PostgreSQL, but "Foo" and "FOO" are different from these three and each other. (The folding of unquoted names to lower case in PostgreSQL is incompatible with the SQL standard, which says that unquoted names should be folded to upper case. Thus, foo should be equivalent to "FOO" not "foo" according to the standard. If you want to write portable applications you are advised to always quote a particular name or never quote it.)

Oracle 的行为类似,通常不鼓励使用带引号的标识符,因为它会导致此类问题。