Rails:从MySQL转换为PostGres打破了Geokit距离计算?

Kev*_*vin 2 postgresql plugins ruby-on-rails geokit

我最近将我的数据库从MySQL切换到PostGres.我也使用GeoKit.当我使用已经播种的新数据库启动我的应用程序时,我收到以下错误:

PGError: ERROR:  function radians(character varying) does not exist
LINE 1: ...COS(0.661045389762993)*COS(-2.12957994527573)*COS(RADIANS(ti...
                                                         ^
HINT:  No function matches the given name and argument types. You might 
need to add explicit type casts.
Run Code Online (Sandbox Code Playgroud)

任何人都知道为什么现在这会破裂?我知道GeoKit仍然有效,因为当数据库被播种时,它仍然在每张票的模型中执行地理编码,它只是不能正确地进行距离计算.

Kev*_*vin 8

对于那些在搜索中查找此答案的人来说,问题是Postgresql要求lat,lng列为十进制或至少是非字符串,而MySQL允许使用两者.