class RemoveGaCookiesPreference < ActiveRecord::Migration
  def up
    Spree::Preference
      .where( key: 'spree/app_configuration/cookies_policy_ga_section')
      .destroy_all
  end

  def down
    # If this preference is re-added to the code, the DB entry will be regenerated
  end
end

class RemoveGaCookiesPreference < ActiveRecord::Migration
  class Spree::Preference < ActiveRecord::Base; end

  def up
    Spree::Preference
      .where( key: 'spree/app_configuration/cookies_policy_ga_section')
      .destroy_all
  end

  def down
    # If this preference is re-added to the code, the DB entry will be regenerated
  end
end

Add model definition to migration to make migration more resilient
Add model definition to migration to make migration more resilient
