CREATE TABLE `download_state` ( `integration_id` integer PRIMARY KEY NOT NULL, `version` text, `speed_down` integer, `speed_up` integer, `paused` integer DEFAULT false NOT NULL, `connection` text, `counts` text NOT NULL, `total` integer DEFAULT 0 NOT NULL, `items` text DEFAULT '[]' NOT NULL, `failed` text, `disks` text, `warnings` text, `since` text DEFAULT '{}' NOT NULL, `updated_at` text NOT NULL, FOREIGN KEY (`integration_id`) REFERENCES `integrations`(`id`) ON UPDATE no action ON DELETE cascade );