CREATE TABLE `surveilr_osquery_ms_node` (
`surveilr_osquery_ms_node_id` text PRIMARY KEY NOT NULL,
`node_key` text NOT NULL,
`host_identifier` text NOT NULL,
`tls_cert_subject` text,
`os_version` text NOT NULL,
`platform` text NOT NULL,
`last_seen` numeric NOT NULL,
`status` text DEFAULT 'active' NOT NULL,
`osquery_version` text,
`osquery_build_platform` text NOT NULL,
`device_id` text NOT NULL,
`behavior_id` text,
`accelerate` integer DEFAULT 60 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 (`device_id`) REFERENCES `device`(`device_id`) ON UPDATE no action ON DELETE no action,
FOREIGN KEY (`behavior_id`) REFERENCES `behavior`(`behavior_id`) ON UPDATE no action ON DELETE no action
)