Skip to content

Commit

Permalink
Delete calculator currency values from db [migration]
Browse files Browse the repository at this point in the history
This depends on #10318 being deployed first.
  • Loading branch information
dacook committed Feb 9, 2023
1 parent f8cceef commit 0f41ee2
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class DeleteCalculatorCurrencyFromSpreePreferences < ActiveRecord::Migration[6.1]
class SpreePreference < ActiveRecord::Base
end

def up
# Delete all currency preferences for calculators, they are no longer used.
rows = SpreePreference.where("key like '/calculator%/currency/%'").delete_all
puts "#{rows} rows deleted."
end

def down
# Sorry, the data was deleted!
raise ActiveRecord::IrreversibleMigration
end
end

0 comments on commit 0f41ee2

Please sign in to comment.