From 221889e6ca1bf9722f7606d5a399ad374590d663 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Mon, 17 Oct 2022 07:53:25 +0200 Subject: [PATCH] add hs-office-membership table --- .../db/changelog/300-hs-office-membership.sql | 29 +++++++++++++++++++ .../db/changelog/db.changelog-master.yaml | 2 ++ 2 files changed, 31 insertions(+) create mode 100644 src/main/resources/db/changelog/300-hs-office-membership.sql diff --git a/src/main/resources/db/changelog/300-hs-office-membership.sql b/src/main/resources/db/changelog/300-hs-office-membership.sql new file mode 100644 index 00000000..12b664b3 --- /dev/null +++ b/src/main/resources/db/changelog/300-hs-office-membership.sql @@ -0,0 +1,29 @@ +--liquibase formatted sql + +-- ============================================================================ +--changeset hs-office-membership-MAIN-TABLE:1 endDelimiter:--// +-- ---------------------------------------------------------------------------- + +CREATE TYPE HsOfficeReasonForTermination AS ENUM ('NONE', 'CANCELLATION', 'TRANSFER', 'DEATH', 'LIQUIDATION', 'EXPULSION'); + + +CREATE CAST (character varying as HsOfficeReasonForTermination) WITH INOUT AS IMPLICIT; + +create table if not exists hs_office_membership +( + uuid uuid unique references RbacObject (uuid) initially deferred, + partnerUuid uuid not null references hs_office_partner(uuid), + mainDebitorUuid uuid not null references hs_office_debitor(uuid), + memberNumber numeric(5) not null, + validity daterange not null, + reasonForTermination HsOfficeReasonForTermination not null +); +--// + + +-- ============================================================================ +--changeset hs-office-membership-MAIN-TABLE-JOURNAL:1 endDelimiter:--// +-- ---------------------------------------------------------------------------- + +call create_journal('hs_office_membership'); +--// diff --git a/src/main/resources/db/changelog/db.changelog-master.yaml b/src/main/resources/db/changelog/db.changelog-master.yaml index 4d041f5c..be4eff6a 100644 --- a/src/main/resources/db/changelog/db.changelog-master.yaml +++ b/src/main/resources/db/changelog/db.changelog-master.yaml @@ -91,3 +91,5 @@ databaseChangeLog: file: db/changelog/253-hs-office-sepamandate-rbac.sql - include: file: db/changelog/258-hs-office-sepamandate-test-data.sql + - include: + file: db/changelog/300-hs-office-membership.sql