add @Version property to all RBAC-Entities (#34)
Co-authored-by: Michael Hoennig <michael@hoennig.de> Reviewed-on: https://dev.hostsharing.net/hostsharing/hs.hsadmin.ng/pulls/34 Reviewed-by: Marc Sandlus <marc.sandlus@hostsharing.net>
This commit is contained in:
		| @@ -7,6 +7,7 @@ | ||||
| create table if not exists hs_office_contact | ||||
| ( | ||||
|     uuid           uuid unique references RbacObject (uuid) initially deferred, | ||||
|     version        int not null default 0, | ||||
|     label          varchar(128) not null, | ||||
|     postalAddress  text, | ||||
|     emailAddresses text, -- TODO.feat: change to json | ||||
|   | ||||
| @@ -17,6 +17,7 @@ CREATE CAST (character varying as HsOfficePersonType) WITH INOUT AS IMPLICIT; | ||||
| create table if not exists hs_office_person | ||||
| ( | ||||
|     uuid           uuid unique references RbacObject (uuid) initially deferred, | ||||
|     version        int not null default 0, | ||||
|     personType     HsOfficePersonType not null, | ||||
|     tradeName      varchar(96), | ||||
|     salutation     varchar(30), | ||||
|   | ||||
| @@ -19,6 +19,7 @@ CREATE CAST (character varying as HsOfficeRelationType) WITH INOUT AS IMPLICIT; | ||||
| create table if not exists hs_office_relation | ||||
| ( | ||||
|     uuid             uuid unique references RbacObject (uuid) initially deferred, -- on delete cascade | ||||
|     version          int not null default 0, | ||||
|     anchorUuid       uuid not null references hs_office_person(uuid), | ||||
|     holderUuid       uuid not null references hs_office_person(uuid), | ||||
|     contactUuid      uuid references hs_office_contact(uuid), | ||||
|   | ||||
| @@ -8,6 +8,7 @@ | ||||
| create table hs_office_partner_details | ||||
| ( | ||||
|     uuid                uuid unique references RbacObject (uuid) initially deferred, | ||||
|     version             int not null default 0, | ||||
|     registrationOffice  varchar(96), | ||||
|     registrationNumber  varchar(96), | ||||
|     birthPlace          varchar(96), | ||||
| @@ -32,8 +33,9 @@ call create_journal('hs_office_partner_details'); | ||||
| create table hs_office_partner | ||||
| ( | ||||
|     uuid                uuid unique references RbacObject (uuid) initially deferred, | ||||
|     version             int not null default 0, | ||||
|     partnerNumber       numeric(5) unique not null, | ||||
|     partnerRelUuid     uuid not null references hs_office_relation(uuid), -- deleted in after delete trigger | ||||
|     partnerRelUuid      uuid not null references hs_office_relation(uuid), -- deleted in after delete trigger | ||||
|     detailsUuid         uuid not null references hs_office_partner_details(uuid) -- deleted in after delete trigger | ||||
| ); | ||||
| --// | ||||
|   | ||||
| @@ -6,6 +6,7 @@ | ||||
| create table hs_office_bankaccount | ||||
| ( | ||||
|     uuid                uuid unique references RbacObject (uuid) initially deferred, | ||||
|     version             int not null default 0, | ||||
|     holder              varchar(64) not null, | ||||
|     iban                varchar(34) not null, | ||||
|     bic                 varchar(11) not null | ||||
|   | ||||
| @@ -7,6 +7,7 @@ | ||||
| create table hs_office_debitor | ||||
| ( | ||||
|     uuid                    uuid unique references RbacObject (uuid) initially deferred, | ||||
|     version                 int not null default 0, | ||||
|     debitorNumberSuffix     char(2) not null check (debitorNumberSuffix::text ~ '^[0-9][0-9]$'), | ||||
|     debitorRelUuid          uuid not null references hs_office_relation(uuid), | ||||
|     billable                boolean not null default true, | ||||
|   | ||||
| @@ -7,6 +7,7 @@ | ||||
| create table if not exists hs_office_sepamandate | ||||
| ( | ||||
|     uuid                uuid unique references RbacObject (uuid) initially deferred, | ||||
|     version      int not null default 0, | ||||
|     debitorUuid         uuid not null references hs_office_debitor(uuid), | ||||
|     bankAccountUuid     uuid not null references hs_office_bankaccount(uuid), | ||||
|     reference           varchar(96) not null, | ||||
|   | ||||
| @@ -11,6 +11,7 @@ CREATE CAST (character varying as HsOfficeReasonForTermination) WITH INOUT AS IM | ||||
| create table if not exists hs_office_membership | ||||
| ( | ||||
|     uuid                    uuid unique references RbacObject (uuid) initially deferred, | ||||
|     version                 int not null default 0, | ||||
|     partnerUuid             uuid not null references hs_office_partner(uuid), | ||||
|     memberNumberSuffix      char(2) not null check (memberNumberSuffix::text ~ '^[0-9][0-9]$'), | ||||
|     validity                daterange not null, | ||||
|   | ||||
| @@ -11,6 +11,7 @@ CREATE CAST (character varying as HsOfficeCoopSharesTransactionType) WITH INOUT | ||||
| create table if not exists hs_office_coopsharestransaction | ||||
| ( | ||||
|     uuid            uuid unique references RbacObject (uuid) initially deferred, | ||||
|     version         int not null default 0, | ||||
|     membershipUuid  uuid not null references hs_office_membership(uuid), | ||||
|     transactionType HsOfficeCoopSharesTransactionType not null, | ||||
|     valueDate       date not null, | ||||
|   | ||||
| @@ -18,6 +18,7 @@ CREATE CAST (character varying as HsOfficeCoopAssetsTransactionType) WITH INOUT | ||||
| create table if not exists hs_office_coopassetstransaction | ||||
| ( | ||||
|     uuid            uuid unique references RbacObject (uuid) initially deferred, | ||||
|     version         int not null default 0, | ||||
|     membershipUuid  uuid not null references hs_office_membership(uuid), | ||||
|     transactionType HsOfficeCoopAssetsTransactionType not null, | ||||
|     valueDate       date not null, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user