From d05caf6fd36abe902b461f960230e61b2d41e148 Mon Sep 17 00:00:00 2001 From: Kevin Janssen Date: Thu, 19 Nov 2026 19:54:55 +0100 Subject: [PATCH] Allow OPNsense snapshots in the tenant-bound observations table --- migrations/0046_opnsense_inventory.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 migrations/0046_opnsense_inventory.sql diff --git a/migrations/0046_opnsense_inventory.sql b/migrations/0046_opnsense_inventory.sql new file mode 100644 index 0000000..9f57afe --- /dev/null +++ b/migrations/0046_opnsense_inventory.sql @@ -0,0 +1,6 @@ +SET LOCAL lock_timeout = '3s'; +SET LOCAL statement_timeout = '30s'; +ALTER TABLE observations DROP CONSTRAINT observations_source_id_check; +ALTER TABLE observations ADD CONSTRAINT observations_source_id_check + CHECK (source_id IN ('linux.base','windows.base','agent.update','opnsense.base')) NOT VALID; +ALTER TABLE observations VALIDATE CONSTRAINT observations_source_id_check;