diff --git a/db/migrate/20230126233821_delete_calculator_currency_from_spree_preferences.rb b/db/migrate/20230126233821_delete_calculator_currency_from_spree_preferences.rb new file mode 100644 index 00000000000..5ffab61fee3 --- /dev/null +++ b/db/migrate/20230126233821_delete_calculator_currency_from_spree_preferences.rb @@ -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