I have created Rails(3.2) application with mysql(5.7.16) database. I have used json column in some tables and it's working fine. But I can see some commented code like following in my schema.rb file
# Could not dump table "shopping_cart_precheckout_details" because of following StandardError
# Unknown type 'json' for column 'special_info'
Migration
class CreateShoppingCartItemSpecialInfos < ActiveRecord::Migration
def change
create_table :shopping_cart_item_special_infos do |t|
t.integer :shopping_cart_checkout_option_id
t.column :special_info, :json
t.timestamps
end
end
end
Is this affect the production environment and why this commented code added in schema.rb file ?
Native support for native JSON column types in Mysql is only available from Rails 5 onwards: https://github.com/rails/rails/pull/21110
For Rails 4, json_on_rails
may be considered: https://github.com/saveriomiroddi/json_on_rails
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With