From b75ca5ee1194fc4d92234bc07a5deb29da50efe1 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Tue, 31 Jan 2023 15:43:56 +1100 Subject: [PATCH] feat: add consumer_version_id index to latest_pact_publication_ids_for_consumer_versions --- ...s_ver_id_ndx_to_latest_pp_id_for_cons_ver.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 db/migrations/20230131_add_cons_ver_id_ndx_to_latest_pp_id_for_cons_ver.rb diff --git a/db/migrations/20230131_add_cons_ver_id_ndx_to_latest_pp_id_for_cons_ver.rb b/db/migrations/20230131_add_cons_ver_id_ndx_to_latest_pp_id_for_cons_ver.rb new file mode 100644 index 000000000..1c3ab5688 --- /dev/null +++ b/db/migrations/20230131_add_cons_ver_id_ndx_to_latest_pp_id_for_cons_ver.rb @@ -0,0 +1,17 @@ +require_relative "migration_helper" + +include PactBroker::MigrationHelper + +Sequel.migration do + up do + alter_table(:latest_pact_publication_ids_for_consumer_versions) do + add_index([:consumer_version_id], name: "latest_pp_ids_for_cons_ver_con_ver_id_ndx") + end + end + + down do + alter_table(:latest_pact_publication_ids_for_consumer_versions) do + drop_index([:consumer_version_id], name: "latest_pp_ids_for_cons_ver_con_ver_id_ndx") + end + end +end