Show known hypervisors and the Hetzner placeholder for virtual machines

This commit is contained in:
2026-11-18 22:39:29 +01:00
parent 08177d8843
commit bcd3bd86ad
13 changed files with 530 additions and 11 deletions
+10
View File
@@ -0,0 +1,10 @@
ALTER TABLE assets
ADD COLUMN hypervisor_asset_id uuid,
ADD CONSTRAINT assets_hypervisor_not_self CHECK (hypervisor_asset_id <> asset_id),
ADD CONSTRAINT assets_same_customer_hypervisor
FOREIGN KEY (tenant_id, hypervisor_asset_id) REFERENCES assets(tenant_id, asset_id)
ON DELETE SET NULL (hypervisor_asset_id);
CREATE INDEX assets_hypervisor_reference ON assets (tenant_id, hypervisor_asset_id)
WHERE hypervisor_asset_id IS NOT NULL;
GRANT UPDATE (hypervisor_asset_id) ON assets TO rmm_app;