Skip to content

Commit

Permalink
Merge branch 'featur/186-krr-db-schema' into feature/192-krr-endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmed-Ghanam committed Oct 9, 2024
2 parents 4227cbf + 2250863 commit 6dc787a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
1 change: 0 additions & 1 deletion src/Altinn.Profile.Integrations/Entities/Person.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace Altinn.Profile.Integrations.Entities;
/// </summary>
[Table("person", Schema = "contact_and_reservation")]
[Index("FnumberAk", Name = "idx_fnumber_ak")]
[Index("MailboxSupplierIdFk", Name = "idx_mailbox_supplier_id_fk")]
[Index("FnumberAk", Name = "person_fnumber_ak_key", IsUnique = true)]
public partial class Person
{
Expand Down
22 changes: 5 additions & 17 deletions src/Altinn.Profile.Integrations/Migration/profiledb.sql
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
-- Drop the database if it exists
DROP DATABASE IF EXISTS profiledb;

-- Create the database
CREATE DATABASE profiledb
WITH
OWNER = postgres
ENCODING = 'UTF8'
LC_COLLATE = 'Norwegian_Norway.1252'
LC_CTYPE = 'Norwegian_Norway.1252'
LOCALE_PROVIDER = 'libc'
TABLESPACE = pg_default
CONNECTION LIMIT = -1
IS_TEMPLATE = False;

-- Create schema if it doesn't exist
-- Create schema if it doesn't exist
CREATE SCHEMA IF NOT EXISTS contact_and_reservation;

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

-- Create table MailboxSupplier
CREATE TABLE IF NOT EXISTS contact_and_reservation.mailbox_supplier (
mailbox_supplier_id INT GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
Expand Down Expand Up @@ -50,5 +39,4 @@ CREATE TABLE IF NOT EXISTS contact_and_reservation.person (
);

-- Indexes for performance
CREATE INDEX idx_mailbox_supplier_id_fk ON contact_and_reservation.person (mailbox_supplier_id_fk);
CREATE INDEX idx_fnumber_ak ON contact_and_reservation.person (fnumber_ak);

0 comments on commit 6dc787a

Please sign in to comment.