From 24feffeef1363b119d5cc84e7ffaaa4a9167ba3b Mon Sep 17 00:00:00 2001 From: Akshay Gupta Date: Thu, 24 Dec 2020 13:12:46 +0530 Subject: [PATCH] Revert "Remove less efficient sync indexes (#1901)" This reverts commit be6a68303c705d477de546499ba9a612b10447ad. --- db/migrate/20201218062046_remove_old_sync_indexes.rb | 9 --------- db/schema.rb | 7 ++++++- 2 files changed, 6 insertions(+), 10 deletions(-) delete mode 100644 db/migrate/20201218062046_remove_old_sync_indexes.rb diff --git a/db/migrate/20201218062046_remove_old_sync_indexes.rb b/db/migrate/20201218062046_remove_old_sync_indexes.rb deleted file mode 100644 index 8ccb15da67..0000000000 --- a/db/migrate/20201218062046_remove_old_sync_indexes.rb +++ /dev/null @@ -1,9 +0,0 @@ -class RemoveOldSyncIndexes < ActiveRecord::Migration[5.2] - def change - remove_index :patients, :updated_at - remove_index :blood_pressures, :updated_at - remove_index :blood_sugars, :updated_at - remove_index :appointments, :updated_at - remove_index :prescription_drugs, :updated_at - end -end diff --git a/db/schema.rb b/db/schema.rb index 21e033818b..72567ed778 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2020_12_18_062046) do +ActiveRecord::Schema.define(version: 2020_12_18_061336) do # These are extensions that must be enabled in order to support this database enable_extension "ltree" @@ -69,6 +69,7 @@ t.index ["patient_id", "scheduled_date"], name: "index_appointments_on_patient_id_and_scheduled_date", order: { scheduled_date: :desc } t.index ["patient_id", "updated_at"], name: "index_appointments_on_patient_id_and_updated_at" t.index ["patient_id"], name: "index_appointments_on_patient_id" + t.index ["updated_at"], name: "index_appointments_on_updated_at" t.index ["user_id"], name: "index_appointments_on_user_id" end @@ -89,6 +90,7 @@ t.index ["patient_id", "updated_at"], name: "index_blood_pressures_on_patient_id_and_updated_at" t.index ["patient_id"], name: "index_blood_pressures_on_patient_id" t.index ["recorded_at"], name: "index_blood_pressures_on_recorded_at" + t.index ["updated_at"], name: "index_blood_pressures_on_updated_at" t.index ["user_id"], name: "index_blood_pressures_on_user_id" end @@ -109,6 +111,7 @@ t.index ["facility_id"], name: "index_blood_sugars_on_facility_id" t.index ["patient_id", "updated_at"], name: "index_blood_sugars_on_patient_id_and_updated_at" t.index ["patient_id"], name: "index_blood_sugars_on_patient_id" + t.index ["updated_at"], name: "index_blood_sugars_on_updated_at" t.index ["user_id"], name: "index_blood_sugars_on_user_id" end @@ -406,6 +409,7 @@ t.index ["registration_facility_id"], name: "index_patients_on_registration_facility_id" t.index ["registration_user_id"], name: "index_patients_on_registration_user_id" t.index ["reminder_consent"], name: "index_patients_on_reminder_consent" + t.index ["updated_at"], name: "index_patients_on_updated_at" end create_table "phone_number_authentications", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| @@ -446,6 +450,7 @@ t.index ["patient_id", "updated_at"], name: "index_prescription_drugs_on_patient_id_and_updated_at" t.index ["patient_id"], name: "index_prescription_drugs_on_patient_id" t.index ["teleconsultation_id"], name: "index_prescription_drugs_on_teleconsultation_id" + t.index ["updated_at"], name: "index_prescription_drugs_on_updated_at" t.index ["user_id"], name: "index_prescription_drugs_on_user_id" end