CREATE TABLE `webhook_deliveries` ( `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, `webhook_id` integer NOT NULL, `event` text NOT NULL, `delivery_id` text NOT NULL, `attempts` integer DEFAULT 1 NOT NULL, `ok` integer NOT NULL, `result` text NOT NULL, `body` text NOT NULL, `retry_of` integer, `created_at` text NOT NULL, FOREIGN KEY (`webhook_id`) REFERENCES `event_webhooks`(`id`) ON UPDATE no action ON DELETE cascade ); --> statement-breakpoint CREATE INDEX `webhook_deliveries_webhook_idx` ON `webhook_deliveries` (`webhook_id`,`created_at`);