surveilr_osquery_ms_distributed_query

Column Type PK Required Default
query_id TEXT Yes Yes
node_key TEXT No Yes
query_name TEXT No Yes
query_sql TEXT No Yes
discovery_query TEXT No No
status TEXT No Yes
elaboration TEXT No No
interval INTEGER No Yes
created_at TIMESTAMPTZ No No CURRENT_TIMESTAMP
created_by TEXT No No 'UNKNOWN'
updated_at TIMESTAMPTZ No No
updated_by TEXT No No
deleted_at TIMESTAMPTZ No No
deleted_by TEXT No No
activity_log TEXT No No

Foreign Keys

Column Name Foreign Key
node_key node_key references surveilr_osquery_ms_node.node_key

Indexes

Column Name Index Name
query_id sqlite_autoindex_surveilr_osquery_ms_distributed_query_1

SQL DDL

CREATE TABLE `surveilr_osquery_ms_distributed_query` (
	`query_id` text PRIMARY KEY NOT NULL,
	`node_key` text NOT NULL,
	`query_name` text NOT NULL,
	`query_sql` text NOT NULL,
	`discovery_query` text,
	`status` text NOT NULL,
	`elaboration` text,
	`interval` integer NOT NULL,
	`created_at` TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
	`created_by` text DEFAULT 'UNKNOWN',
	`updated_at` TIMESTAMPTZ,
	`updated_by` text,
	`deleted_at` TIMESTAMPTZ,
	`deleted_by` text,
	`activity_log` text,
	FOREIGN KEY (`node_key`) REFERENCES `surveilr_osquery_ms_node`(`node_key`) ON UPDATE no action ON DELETE no action
)