From 0d8a205b7cd9a914df141f67c85f95f045f92ee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Casta=C3=B1o=20Arteaga?= Date: Mon, 20 Nov 2023 11:21:10 +0100 Subject: [PATCH] Add some missing indexes to event table (#3504) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add some missing event table indexes Signed-off-by: Sergio CastaƱo Arteaga --- database/migrations/schema/051_missing_event_indexes.sql | 7 +++++++ database/tests/schema/schema.sql | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 database/migrations/schema/051_missing_event_indexes.sql diff --git a/database/migrations/schema/051_missing_event_indexes.sql b/database/migrations/schema/051_missing_event_indexes.sql new file mode 100644 index 000000000..5624d3cd8 --- /dev/null +++ b/database/migrations/schema/051_missing_event_indexes.sql @@ -0,0 +1,7 @@ +create index if not exists event_repository_id_idx on event (repository_id); +create index if not exists event_package_id_idx on event (package_id); + +---- create above / drop below ---- + +drop index if exists event_repository_id_idx; +drop index if exists event_package_id_idx; diff --git a/database/tests/schema/schema.sql b/database/tests/schema/schema.sql index 591b73b2f..0b4ecd536 100644 --- a/database/tests/schema/schema.sql +++ b/database/tests/schema/schema.sql @@ -311,7 +311,9 @@ select indexes_are('email_verification_code', array[ ]); select indexes_are('event', array[ 'event_pkey', - 'event_not_processed_idx' + 'event_not_processed_idx', + 'event_repository_id_idx', + 'event_package_id_idx' ]); select indexes_are('image', array[ 'image_pkey',