Skip to content

Commit

Permalink
Add migration to drop dead spree_mail_methods table and some dead mai…
Browse files Browse the repository at this point in the history
…l_methods preferences
  • Loading branch information
luisramos0 committed Apr 29, 2020
1 parent 6853714 commit a909052
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
16 changes: 16 additions & 0 deletions db/migrate/20200429122446_drop_mail_methods.rb
@@ -0,0 +1,16 @@
class DropMailMethods < ActiveRecord::Migration
def up
drop_table :spree_mail_methods

# delete mail_method preferences associated with the old MailMethod model
execute "DELETE FROM spree_preferences WHERE key LIKE 'spree/mail_method%'"
end

def down
create_table :spree_mail_methods do |t|
t.string :environment
t.boolean :active, default: true
t.timestamps
end
end
end
9 changes: 1 addition & 8 deletions db/schema.rb
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20200327105910) do
ActiveRecord::Schema.define(:version => 20200429122446) do

create_table "adjustment_metadata", :force => true do |t|
t.integer "adjustment_id"
Expand Down Expand Up @@ -506,13 +506,6 @@
t.datetime "updated_at", :null => false
end

create_table "spree_mail_methods", :force => true do |t|
t.string "environment"
t.boolean "active", :default => true
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end

create_table "spree_option_types", :force => true do |t|
t.string "name", :limit => 100
t.string "presentation", :limit => 100
Expand Down
2 changes: 0 additions & 2 deletions lib/tasks/data/anonymize_data.rake
Expand Up @@ -18,8 +18,6 @@ namespace :ofn do
anonymize_payments_accounts

Spree::TokenizedPermission.update_all("token = null")
ActiveRecord::Base.connection.execute("update spree_mail_methods
set environment = '#{Rails.env}'")

# Delete all preferences that may contain sensitive information
Spree::Preference
Expand Down

0 comments on commit a909052

Please sign in to comment.