From f5a59a11003b15bba6965639472bb0e34031448c Mon Sep 17 00:00:00 2001 From: Terje Holene Date: Fri, 18 Oct 2024 15:55:25 +0200 Subject: [PATCH] Add index for person f nr --- .../Migration/v0.00/01-setup-schema.sql | 2 +- .../Migration/v0.01/01-setup-grants.sql | 2 +- .../Migration/v0.01/02-setup-tables.sql | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Altinn.Profile.Integrations/Migration/v0.00/01-setup-schema.sql b/src/Altinn.Profile.Integrations/Migration/v0.00/01-setup-schema.sql index 13a54d6..9d2e35d 100644 --- a/src/Altinn.Profile.Integrations/Migration/v0.00/01-setup-schema.sql +++ b/src/Altinn.Profile.Integrations/Migration/v0.00/01-setup-schema.sql @@ -1,2 +1,2 @@ -- Create schema if it doesn't exist -CREATE SCHEMA IF NOT EXISTS contact_and_reservation; \ No newline at end of file +CREATE SCHEMA IF NOT EXISTS contact_and_reservation; diff --git a/src/Altinn.Profile.Integrations/Migration/v0.01/01-setup-grants.sql b/src/Altinn.Profile.Integrations/Migration/v0.01/01-setup-grants.sql index 9e5d3ea..bcbdffd 100644 --- a/src/Altinn.Profile.Integrations/Migration/v0.01/01-setup-grants.sql +++ b/src/Altinn.Profile.Integrations/Migration/v0.01/01-setup-grants.sql @@ -1,3 +1,3 @@ -- Grant access to the schema GRANT ALL ON SCHEMA contact_and_reservation TO platform_profile_admin; -GRANT USAGE ON SCHEMA contact_and_reservation TO platform_profile; \ No newline at end of file +GRANT USAGE ON SCHEMA contact_and_reservation TO platform_profile; diff --git a/src/Altinn.Profile.Integrations/Migration/v0.01/02-setup-tables.sql b/src/Altinn.Profile.Integrations/Migration/v0.01/02-setup-tables.sql index 8eb8cb4..8c647c4 100644 --- a/src/Altinn.Profile.Integrations/Migration/v0.01/02-setup-tables.sql +++ b/src/Altinn.Profile.Integrations/Migration/v0.01/02-setup-tables.sql @@ -30,3 +30,6 @@ CREATE TABLE IF NOT EXISTS contact_and_reservation.person ( CONSTRAINT fk_mailbox_supplier FOREIGN KEY (mailbox_supplier_id_fk) REFERENCES contact_and_reservation.mailbox_supplier (mailbox_supplier_id), CONSTRAINT chk_language_code CHECK (language_code ~* '^[a-z]{2}$') ); + +-- Indexes for performance +CREATE INDEX idx_fnumber_ak ON contact_and_reservation.person (fnumber_ak);