-- CreateTable
CREATE TABLE "openai_config" (
    "id" TEXT NOT NULL DEFAULT gen_random_uuid(),
    "api_key" TEXT NOT NULL,
    "assistant_id" TEXT NOT NULL,
    "is_active" BOOLEAN NOT NULL DEFAULT true,
    "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,

    CONSTRAINT "openai_config_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE INDEX "openai_config_is_active_idx" ON "openai_config"("is_active");

-- AlterTable
ALTER TABLE "conversations" ADD COLUMN "openai_summary" TEXT,
ADD COLUMN "openai_evaluation" TEXT,
ADD COLUMN "openai_feedback" TEXT,
ADD COLUMN "openai_transcript" TEXT,
ADD COLUMN "feedback_status" TEXT DEFAULT 'pending_transcript';

-- CreateIndex
CREATE INDEX "conversations_feedback_status_idx" ON "conversations"("feedback_status");
