unique identifers for hosting assets per type #107

Merged
hsh-michaelhoennig merged 2 commits from unique-identifiers-for-hosting-assets into master 2024-09-25 10:53:46 +02:00
Showing only changes of commit 6ad204b325 - Show all commits

View File

@ -41,6 +41,8 @@ create table if not exists hs_hosting.asset
config jsonb not null, config jsonb not null,
alarmContactUuid uuid null references hs_office.contact(uuid) initially deferred, 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 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')) check (bookingItemUuid is not null or parentAssetUuid is not null or type in ('DOMAIN_SETUP', 'IPV4_NUMBER', 'IPV6_NUMBER'))
); );