-- CreateTable
CREATE TABLE "translation_exceptions" (
    "id" UUID NOT NULL DEFAULT gen_random_uuid(),
    "user_id" UUID NOT NULL,
    "text" VARCHAR(500) NOT NULL,
    "match_type" VARCHAR(20) NOT NULL DEFAULT 'exact',
    "notes" TEXT,
    "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updated_at" TIMESTAMP(3) NOT NULL,

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

-- CreateIndex
CREATE INDEX "translation_exceptions_user_id_idx" ON "translation_exceptions"("user_id");

-- CreateIndex
CREATE UNIQUE INDEX "translation_exceptions_user_id_text_key" ON "translation_exceptions"("user_id", "text");

-- AddForeignKey
ALTER TABLE "translation_exceptions" ADD CONSTRAINT "translation_exceptions_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
