From 6ad204b3256edfb8f3df19d989b468b4c2ba856e Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Mon, 23 Sep 2024 16:33:20 +0200 Subject: [PATCH] unique identifers for hosting assets per type --- .../7-hs-hosting/701-hosting-asset/7010-hs-hosting-asset.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/resources/db/changelog/7-hs-hosting/701-hosting-asset/7010-hs-hosting-asset.sql b/src/main/resources/db/changelog/7-hs-hosting/701-hosting-asset/7010-hs-hosting-asset.sql index 304e7337..d8d1393e 100644 --- a/src/main/resources/db/changelog/7-hs-hosting/701-hosting-asset/7010-hs-hosting-asset.sql +++ b/src/main/resources/db/changelog/7-hs-hosting/701-hosting-asset/7010-hs-hosting-asset.sql @@ -41,6 +41,8 @@ create table if not exists hs_hosting.asset config jsonb not null, alarmContactUuid uuid null references hs_office.contact(uuid) initially deferred, + unique (type, identifier), -- at least as long as we need to be compatible to the legacy system + constraint hosting_asset_has_booking_item_or_parent_asset check (bookingItemUuid is not null or parentAssetUuid is not null or type in ('DOMAIN_SETUP', 'IPV4_NUMBER', 'IPV6_NUMBER')) );