CREATE TABLE `deployment_logs` ( `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, `deployment_id` text NOT NULL, `ts` integer NOT NULL, `stream` text NOT NULL, `line` text NOT NULL, FOREIGN KEY (`deployment_id`) REFERENCES `deployments`(`id`) ON UPDATE no action ON DELETE no action ); --> statement-breakpoint CREATE INDEX `deployment_logs_idx` ON `deployment_logs` (`deployment_id`,`id`);--> statement-breakpoint CREATE TABLE `deployments` ( `id` text PRIMARY KEY NOT NULL, `name` text NOT NULL, `runtime_id` text NOT NULL, `model_id` text NOT NULL, `options` text NOT NULL, `cpus` real, `memory_mb` integer, `host_port` integer, `desired_state` text DEFAULT 'stopped' NOT NULL, `state` text DEFAULT 'stopped' NOT NULL, `delete_requested_at` integer, `container_id` text, `container_name` text, `command` text, `image_id` text, `started_at` integer, `ready_at` integer, `stopped_at` integer, `exit_code` integer, `error` text, `stats` text, `created_at` integer NOT NULL, `updated_at` integer NOT NULL, FOREIGN KEY (`runtime_id`) REFERENCES `runtimes`(`id`) ON UPDATE no action ON DELETE no action, FOREIGN KEY (`model_id`) REFERENCES `models`(`id`) ON UPDATE no action ON DELETE no action );