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);