Skip to content

Commit b2a0481

Browse files
committed
Remove location_id column
This removes the unused column from the `patient_locations` table which has since been replaced by `school_id`. Jira-Issue: MAV-7116 Jira-Issue: MAV-7113
1 parent 1ee847b commit b2a0481

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

app/models/patient_location.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#
1717
# idx_on_patient_id_school_id_academic_year_652216fa07 (patient_id,school_id,academic_year) UNIQUE
1818
# idx_on_school_id_academic_year_patient_id_c647e75f26 (school_id,academic_year,patient_id) UNIQUE
19-
# index_patient_locations_on_location_id (location_id)
2019
# index_patient_locations_on_school_id (school_id)
2120
# index_patient_locations_on_school_id_and_academic_year (school_id,academic_year)
2221
#
@@ -27,8 +26,6 @@
2726
#
2827

2928
class PatientLocation < ApplicationRecord
30-
self.ignored_columns = %i[location_id]
31-
3229
audited associated_with: :patient
3330
has_associated_audits
3431

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# frozen_string_literal: true
2+
3+
class RemoveLocationFromPatientLocations < ActiveRecord::Migration[8.1]
4+
def change
5+
remove_column :patient_locations, :location_id, :integer
6+
end
7+
end

db/schema.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -650,11 +650,9 @@
650650
t.integer "academic_year", null: false
651651
t.datetime "created_at", null: false
652652
t.daterange "date_range", default: -::Float::INFINITY...::Float::INFINITY, null: false
653-
t.bigint "location_id"
654653
t.bigint "patient_id", null: false
655654
t.bigint "school_id", null: false
656655
t.datetime "updated_at", null: false
657-
t.index ["location_id"], name: "index_patient_locations_on_location_id"
658656
t.index ["patient_id", "school_id", "academic_year"], name: "idx_on_patient_id_school_id_academic_year_652216fa07", unique: true
659657
t.index ["school_id", "academic_year", "patient_id"], name: "idx_on_school_id_academic_year_patient_id_c647e75f26", unique: true
660658
t.index ["school_id", "academic_year"], name: "index_patient_locations_on_school_id_and_academic_year"

spec/factories/patient_locations.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#
1717
# idx_on_patient_id_school_id_academic_year_652216fa07 (patient_id,school_id,academic_year) UNIQUE
1818
# idx_on_school_id_academic_year_patient_id_c647e75f26 (school_id,academic_year,patient_id) UNIQUE
19-
# index_patient_locations_on_location_id (location_id)
2019
# index_patient_locations_on_school_id (school_id)
2120
# index_patient_locations_on_school_id_and_academic_year (school_id,academic_year)
2221
#

spec/models/patient_location_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#
1717
# idx_on_patient_id_school_id_academic_year_652216fa07 (patient_id,school_id,academic_year) UNIQUE
1818
# idx_on_school_id_academic_year_patient_id_c647e75f26 (school_id,academic_year,patient_id) UNIQUE
19-
# index_patient_locations_on_location_id (location_id)
2019
# index_patient_locations_on_school_id (school_id)
2120
# index_patient_locations_on_school_id_and_academic_year (school_id,academic_year)
2221
#

0 commit comments

Comments
 (0)