#実現したいこと
・Railsアプリのあるモデルに、json型の画像格納用カラムを追加したいです。
・CarrieWaveを用いて複数の画像を投稿するため、こちらのやり方で実現したいと思っています。
#エラーメッセージ
console
1-- add_column(:places, :pictures, :json) 2rails aborted! 3StandardError: An error has occurred, all later migrations canceled: 4 5Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'json' at line 1: ALTER TABLE `places` ADD `pictures` json
マイグレーションを実行すると。上記のようなエラーになります。
#現状
console
1$ rails dbconsole 2mysql> status 3Server version: 5.5.60 MySQL Community Server (GPL) 4UNIX socket: /var/lib/mysql/mysql.sock
databaseyml
1default: &default 2 adapter: mysql2 3 encoding: utf8 4 pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 5 username: root 6 password: 7 host: localhost 8 9development: 10 <<: *default 11 database:
#環境
Ruby2.4
Rails 5.2
DevelopmentではMySQL2 5.5.60?
herokuではpostgreSQL
Cloud9
MySQLのバージョンが良くない?のでしょうか。
MySQL「2」の場合の方策をご存知の方、何かアドバイスをいただけないでしょうか。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/09/06 06:56