We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2984d05 + 06fde4a commit 80926ccCopy full SHA for 80926cc
lib/tasks/data_migrations.rake
@@ -0,0 +1,15 @@
1
+# frozen_string_literal: true
2
+
3
+namespace :data_migrations do
4
+ desc "Fix vaccination record locations where both location_id and location_name is set"
5
+ task fix_vaccination_record_locations: :environment do
6
+ vaccination_records =
7
+ VaccinationRecord
8
+ .where.not(location_id: nil)
9
+ .where.not(location_name: nil)
10
11
+ puts "#{vaccination_records.count} vaccination records need fixing"
12
13
+ vaccination_records.update_all(location_id: nil)
14
+ end
15
+end
0 commit comments