Files
rust-discovery/migrations/0016_agent_update_observation_scope.sql
2026-11-15 16:44:24 +01:00

10 lines
588 B
SQL

-- Passive agent-update observations share the existing tenant/device-bound
-- ingest path. Preserve both base scopes and every existing row/RLS/FK.
-- SQLx applies this file transactionally and records its normal checksum.
SET LOCAL lock_timeout = '3s';
SET LOCAL statement_timeout = '15s';
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')) NOT VALID;
ALTER TABLE observations VALIDATE CONSTRAINT observations_source_id_check;