Initial commit
This commit is contained in:
14
db/migrate/20200504183201_change_market_data.rb
Normal file
14
db/migrate/20200504183201_change_market_data.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class ChangeMarketData < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :markets, :data, :json, after: :position
|
||||
|
||||
Market.all.each do |m|
|
||||
next if m.data_encrypted.nil?
|
||||
|
||||
m.data = Vault::Rails.decrypt("transit", "#{Vault.application}_markets_data", m.data_encrypted)
|
||||
m.save
|
||||
end
|
||||
|
||||
remove_column :markets, :data_encrypted
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user