Skip to content

Commit

Permalink
Fix data column migration for Rails 6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
excid3 committed Jan 22, 2021
1 parent 56e77d1 commit 012129a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion db/migrate/20200603134434_add_data_to_pay_models.rb
Expand Up @@ -5,7 +5,12 @@ def change
end

def data_column_type
case ActiveRecord::Base.configurations.default_hash.dig("adapter")
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"
Expand Down

0 comments on commit 012129a

Please sign in to comment.