【发布时间】:2019-01-04 22:55:02
【问题描述】:
我有一个不幸的任务是让一些遗留数据与 rails ap 一起工作。一些id字段是字符串
:client_id => "30430"
但是在 postgres(我们更喜欢使用它)中,关联查询由于数据类型不匹配而阻塞。有没有解决的办法?
PG::UndefinedFunction: ERROR: operator does not exist: bigint = character varying LINE 1: ...ients" INNER JOIN "reservation" ON "clients"."id" = "reserva...
No operator matches the given name and argument type(s). You might need to add explicit type casts.
明确地说,我正在寻找不涉及更改基础数据的解决方案(尽管那将是我的首选)
【问题讨论】:
标签: ruby-on-rails associations legacy