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 000000000000..5ffab61fee31 --- /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 diff --git a/db/schema.rb b/db/schema.rb index c711e259f714..a9d93297eae7 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2023_01_17_043628) do +ActiveRecord::Schema.define(version: 2023_01_26_233821) do # These are extensions that must be enabled in order to support this database enable_extension "pg_stat_statements"