-- CreateTable
CREATE TABLE "SpamFeedback" (
    "id" TEXT NOT NULL,
    "userId" TEXT NOT NULL,
    "phoneNumber" TEXT NOT NULL,
    "phoneNumberHash" TEXT NOT NULL,
    "isSpam" BOOLEAN NOT NULL,
    "label" TEXT,
    "metadata" TEXT,
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,

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

-- CreateIndex
CREATE INDEX "SpamFeedback_userId_idx" ON "SpamFeedback"("userId");

-- CreateIndex
CREATE INDEX "SpamFeedback_phoneNumberHash_idx" ON "SpamFeedback"("phoneNumberHash");

-- CreateIndex
CREATE INDEX "SpamFeedback_createdAt_idx" ON "SpamFeedback"("createdAt");

-- AddForeignKey
ALTER TABLE "SpamFeedback" ADD CONSTRAINT "SpamFeedback_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
