Files
rust-discovery/migrations/0003_live_query_idempotency.sql
BuTzZ 6c3203d725
Rust development slice / linux (push) Failing after 1m10s
feat: snapshot Linux-first RMM MVP and pause handover
2026-11-12 22:06:25 +01:00

11 lines
654 B
SQL

CREATE TABLE live_query_requests (
tenant_id uuid NOT NULL, principal text NOT NULL, idempotency_key text NOT NULL,
request_hash text NOT NULL, plan_id uuid NOT NULL,
PRIMARY KEY(tenant_id,principal,idempotency_key),
FOREIGN KEY(tenant_id,plan_id) REFERENCES operation_plans(tenant_id,plan_id)
);
ALTER TABLE live_query_requests ENABLE ROW LEVEL SECURITY;
ALTER TABLE live_query_requests FORCE ROW LEVEL SECURITY;
CREATE POLICY tenant_scope ON live_query_requests USING (tenant_id::text=current_setting('app.tenant_id',true)) WITH CHECK (tenant_id::text=current_setting('app.tenant_id',true));
GRANT SELECT, INSERT ON live_query_requests TO rmm_app;