CREATE TABLE `speedtest_results` ( `integration_id` integer NOT NULL, `result_id` integer NOT NULL, `at` text NOT NULL, `status` text NOT NULL, `download_bps` real, `upload_bps` real, `ping_ms` real, `healthy` integer, PRIMARY KEY(`integration_id`, `result_id`), FOREIGN KEY (`integration_id`) REFERENCES `integrations`(`id`) ON UPDATE no action ON DELETE cascade ); --> statement-breakpoint CREATE INDEX `speedtest_results_at_idx` ON `speedtest_results` (`integration_id`,`at`);