Sha256: 9a770e72b5e7fa65e40afe8c5c031088bcaf53b8d560f3ca2b2a36033308ba4f
Contents?: true
Size: 526 Bytes
Versions: 16
Compression:
Stored size: 526 Bytes
Contents
class AddDataToPayModels < ActiveRecord::Migration[4.2] def change add_column :pay_subscriptions, :data, data_column_type add_column :pay_charges, :data, data_column_type end def data_column_type default_hash = ActiveRecord::Base.configurations.default_hash # Rails 6.1 uses a symbol key instead of a string adapter = default_hash.dig(:adapter) || default_hash.dig("adapter") case adapter when "mysql2" :json when "postgresql" :jsonb else :text end end end
Version data entries
16 entries across 16 versions & 1 rubygems