2022-09-07 20:24:35 +02:00
|
|
|
--liquibase formatted sql
|
|
|
|
|
|
|
|
-- ============================================================================
|
2022-09-13 13:27:52 +02:00
|
|
|
--changeset hs-office-person-MAIN-TABLE:1 endDelimiter:--//
|
2022-09-07 20:24:35 +02:00
|
|
|
-- ----------------------------------------------------------------------------
|
|
|
|
|
2024-01-24 15:18:44 +01:00
|
|
|
CREATE TYPE HsOfficePersonType AS ENUM (
|
|
|
|
'??', -- unknown
|
|
|
|
'NP', -- natural person
|
|
|
|
'LP', -- legal person
|
|
|
|
'IF', -- incorporated firm
|
|
|
|
'UF', -- unincorporated firm
|
|
|
|
'PI'); -- public institution
|
2022-09-07 20:24:35 +02:00
|
|
|
|
2022-09-13 13:27:52 +02:00
|
|
|
CREATE CAST (character varying as HsOfficePersonType) WITH INOUT AS IMPLICIT;
|
2022-09-07 20:24:35 +02:00
|
|
|
|
2022-09-13 13:27:52 +02:00
|
|
|
create table if not exists hs_office_person
|
2022-09-07 20:24:35 +02:00
|
|
|
(
|
2022-09-13 10:58:54 +02:00
|
|
|
uuid uuid unique references RbacObject (uuid) initially deferred,
|
2022-09-13 13:27:52 +02:00
|
|
|
personType HsOfficePersonType not null,
|
2022-09-07 20:24:35 +02:00
|
|
|
tradeName varchar(96),
|
|
|
|
givenName varchar(48),
|
|
|
|
familyName varchar(48)
|
|
|
|
);
|
|
|
|
--//
|
2022-10-13 08:23:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
-- ============================================================================
|
|
|
|
--changeset hs-office-person-MAIN-TABLE-JOURNAL:1 endDelimiter:--//
|
|
|
|
-- ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
call create_journal('hs_office_person');
|
|
|
|
--//
|