postgres使っていてridgepoleで文字列から数値型への変換エラー
Apr 13th, 2017
表題のことをやろうとしたらエラーがでた。
1
2
|
[ERROR] PG::DatatypeMismatch: ERROR: column "count" cannot be cast automatically to type integer
HINT: You might need to specify "USING count::integer".
|
Schemafileをこうすればいけました。
1
2
3
|
create_table "products", force: :cascade do |t|
t.integer 'count', using: 'count::integer'
end
|