CREATE TABLE `jellyfin_readings` ( `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, `integration_id` integer NOT NULL, `at` text NOT NULL, `streams` integer NOT NULL, `transcodes` integer NOT NULL, FOREIGN KEY (`integration_id`) REFERENCES `integrations`(`id`) ON UPDATE no action ON DELETE cascade ); --> statement-breakpoint CREATE INDEX `jellyfin_readings_idx` ON `jellyfin_readings` (`integration_id`,`at`);--> statement-breakpoint CREATE TABLE `jellyfin_state` ( `integration_id` integer PRIMARY KEY NOT NULL, `server_name` text, `version` text, `os` text, `pending_restart` integer DEFAULT false NOT NULL, `update_available` integer DEFAULT false NOT NULL, `streams` text DEFAULT '[]' NOT NULL, `tasks` text DEFAULT '[]' NOT NULL, `movies` integer, `series` integer, `episodes` integer, `songs` integer, `failed_logins_24h` integer, `updated_at` text NOT NULL, FOREIGN KEY (`integration_id`) REFERENCES `integrations`(`id`) ON UPDATE no action ON DELETE cascade );