1

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 ADD image_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?

shingo.nakanishi
  • 2,045
  • 2
  • 21
  • 55

1 Answers1

-1

I got the comment

From the blog post... "adds a range on JSON supporting functions, even though a JSON datatype isn't implemented yet".

shingo.nakanishi
  • 2,045
  • 2
  • 21
  • 55