2
私はHerokuのにdb:push
をやろうとしているが、このエラーが取得しています:PGError:ERROR:「is_required」欄には、boolean型であるが、式が整数型である
!!! 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
を使用してブール値として設定されます。
ここで何をすべきかわかりません。
SQLiteは、booleanデータを0と1に制限された整数として格納します。PostgreSQLでは、booleanは別のデータ型です。明示的にPostgreSQLで以下のように動作します: 'is_required :: boolean'。 –
スキーマまたはデータからエラーが発生していますか? –
データから来て、ブール値のデータが "0"と "1"として格納されています – Shpigford