Error
rails aborted! StandardError: An error has occurred, all later migrations canceled:
Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'json' at line 1: ALTER TABLE
lessons
ADDimage_lessons
json
version
% mysql --version
mysql Ver 15.1 Distrib 10.2.7-MariaDB, for osx10.12 (x86_64) using readline 5.1
migrate file
class AddImageLessonsToLessons < ActiveRecord::Migration[5.1]
def change
add_column :lessons, :image_lessons, :json
end
end
reference
How to add a JSON column in MySQL with Rails 5 Migration
https://mariadb.com/resources/blog/json-mariadb-102
I think the mariadb support json. How to fix the error?