/*
  Warnings:

  - You are about to drop the column `agent_version` on the `agent_invocations` table. All the data in the column will be lost.
  - You are about to drop the column `gateway_provider` on the `agent_invocations` table. All the data in the column will be lost.
  - You are about to drop the column `workflow_id` on the `agent_invocations` table. All the data in the column will be lost.
  - Added the required column `input_hash` to the `agent_invocations` table without a default value. This is not possible if the table is not empty.
  - Added the required column `model_provider` to the `agent_invocations` table without a default value. This is not possible if the table is not empty.
  - Added the required column `prompt_version` to the `agent_invocations` table without a default value. This is not possible if the table is not empty.
  - Added the required column `skill_key` to the `agent_invocations` table without a default value. This is not possible if the table is not empty.
  - Added the required column `workflow_run_id` to the `agent_invocations` table without a default value. This is not possible if the table is not empty.
  - Made the column `model_name` on table `agent_invocations` required. This step will fail if there are existing NULL values in that column.

*/
-- AlterTable
ALTER TABLE "agent_invocations" DROP COLUMN "agent_version",
DROP COLUMN "gateway_provider",
DROP COLUMN "workflow_id",
ADD COLUMN     "cache_hit" BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN     "eval_mode" TEXT NOT NULL DEFAULT 'production',
ADD COLUMN     "golden_set_case_id" TEXT,
ADD COLUMN     "input_hash" TEXT NOT NULL,
ADD COLUMN     "judge_rubric" JSONB,
ADD COLUMN     "judge_score" DECIMAL(3,2),
ADD COLUMN     "model_provider" TEXT NOT NULL,
ADD COLUMN     "parent_invocation_id" UUID,
ADD COLUMN     "prompt_version" TEXT NOT NULL,
ADD COLUMN     "skill_key" TEXT NOT NULL,
ADD COLUMN     "workflow_run_id" UUID NOT NULL,
ALTER COLUMN "model_name" SET NOT NULL;

-- CreateIndex
CREATE INDEX "agent_invocations_skill_key_prompt_version_started_at_idx" ON "agent_invocations"("skill_key", "prompt_version", "started_at");

-- CreateIndex
CREATE INDEX "agent_invocations_workflow_run_id_idx" ON "agent_invocations"("workflow_run_id");

-- CreateIndex
CREATE INDEX "agent_invocations_parent_invocation_id_idx" ON "agent_invocations"("parent_invocation_id");

-- CreateIndex
CREATE INDEX "agent_invocations_input_hash_idx" ON "agent_invocations"("input_hash");

-- CreateIndex
CREATE INDEX "agent_invocations_eval_mode_skill_key_idx" ON "agent_invocations"("eval_mode", "skill_key");
