Remove tasks to upgrade to version 2.2
Note that, while we're no longer including them as part of the `execute_release_2.2.0_tasks` task, we're keeping the tasks to remove duplicate poll voters and poll options just in case there are some unexpected issues when adding a unique database index while upgrading to version 2.3.0. We'll remove them in version 2.4.0.
This commit is contained in:
@@ -3,12 +3,8 @@ namespace :consul do
|
||||
task execute_release_tasks: ["settings:rename_setting_keys",
|
||||
"settings:add_new_settings",
|
||||
"cache:clear",
|
||||
"execute_release_2.2.0_tasks"]
|
||||
"execute_release_2.3.0_tasks"]
|
||||
|
||||
desc "Runs tasks needed to upgrade from 2.1.1 to 2.2.0"
|
||||
task "execute_release_2.2.0_tasks": [
|
||||
"db:mask_ips",
|
||||
"polls:remove_duplicate_voters",
|
||||
"polls:populate_option_id"
|
||||
]
|
||||
desc "Runs tasks needed to upgrade from 2.2.2 to 2.3.0"
|
||||
task "execute_release_2.3.0_tasks": []
|
||||
end
|
||||
|
||||
@@ -4,15 +4,4 @@ namespace :db do
|
||||
I18n.enforce_available_locales = false
|
||||
Tenant.switch(args[:tenant]) { load(Rails.root.join("db", "dev_seeds.rb")) }
|
||||
end
|
||||
|
||||
desc "Mask IPs collected with Ahoy"
|
||||
task mask_ips: :environment do
|
||||
ApplicationLogger.new.info "Masking tracked IPs collected with Ahoy"
|
||||
|
||||
Tenant.run_on_each do
|
||||
Visit.find_each do |visit|
|
||||
visit.update_column :ip, Ahoy.mask_ip(visit.ip)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe "rake db:mask_ips" do
|
||||
before { Rake::Task["db:mask_ips"].reenable }
|
||||
|
||||
it "mask IPs on all tenants" do
|
||||
create(:visit, ip: "1.1.1.1")
|
||||
create(:visit, ip: "1.1.1.2")
|
||||
create(:visit, ip: "1.1.2.2")
|
||||
|
||||
create(:tenant, schema: "myhometown")
|
||||
|
||||
Tenant.switch("myhometown") do
|
||||
create(:visit, ip: "1.1.1.1")
|
||||
create(:visit, ip: "1.1.1.2")
|
||||
create(:visit, ip: "1.1.3.3")
|
||||
end
|
||||
|
||||
Rake.application.invoke_task("db:mask_ips")
|
||||
|
||||
expect(Visit.pluck(:ip)).to match_array %w[1.1.1.0 1.1.1.0 1.1.2.0]
|
||||
|
||||
Tenant.switch("myhometown") do
|
||||
expect(Visit.pluck(:ip)).to match_array %w[1.1.1.0 1.1.1.0 1.1.3.0]
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user