CREATE TABLE `alert_tickets` ( `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, `alert_key` text NOT NULL, `status` text NOT NULL, `seen_count` integer DEFAULT 1 NOT NULL, `integration_id` integer, `ticket_number` text, `grouped` integer DEFAULT false NOT NULL, `severity` text NOT NULL, `message` text NOT NULL, `first_seen_at` text NOT NULL, `last_seen_at` text NOT NULL, `ticketed_at` text, `cleared_at` text, FOREIGN KEY (`integration_id`) REFERENCES `integrations`(`id`) ON UPDATE no action ON DELETE set null ); --> statement-breakpoint CREATE INDEX `alert_tickets_key_idx` ON `alert_tickets` (`alert_key`);