我正在尝试对 Heroku 执行 db:push
,但出现此错误:
!!! Caught Server Exception
HTTP CODE: 500
Taps Server Error: PGError: ERROR: column "is_required" is of type boolean but expression is of type integer
LINE 1: ..." ("id", "question_id", "text", "response_class", "is_requir...
^
HINT: You will need to rewrite or cast the expression.
我正在从本地数据库(sqlite)推送到 Heroku 的 PostgreSQL 数据库。
is_required
列使用 t.boolean "is_required", :default => false
设置为 bool 值。
不确定在这里做什么。
最佳答案
在 pgAdmin 中玩转;看起来 postgres 更喜欢 't'
或 'f'
形式的默认值。不过,我没有安装 ruby 来试用它。
关于sql - PGError : ERROR: column "is_required" is of type boolean but expression is of type integer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7947814/