0016_interactions_form.sql 984 B

12345678910111213141516171819
  1. PRAGMA foreign_keys=OFF;--> statement-breakpoint
  2. CREATE TABLE `__new_interactions` (
  3. `id` text PRIMARY KEY NOT NULL,
  4. `session_id` text NOT NULL,
  5. `run_id` text,
  6. `kind` text NOT NULL,
  7. `request` text NOT NULL,
  8. `response` text,
  9. `status` text NOT NULL,
  10. `created_at` text DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ','now')) NOT NULL,
  11. `resolved_at` text,
  12. `expires_at` text NOT NULL
  13. );
  14. --> statement-breakpoint
  15. INSERT INTO `__new_interactions`("id", "session_id", "run_id", "kind", "request", "response", "status", "created_at", "resolved_at", "expires_at") SELECT "id", "session_id", "run_id", "kind", "request", "response", "status", "created_at", "resolved_at", "expires_at" FROM `interactions`;--> statement-breakpoint
  16. DROP TABLE `interactions`;--> statement-breakpoint
  17. ALTER TABLE `__new_interactions` RENAME TO `interactions`;--> statement-breakpoint
  18. PRAGMA foreign_keys=ON;--> statement-breakpoint
  19. CREATE INDEX `interactions_session_idx` ON `interactions` (`session_id`,`status`);