-- CreateEnum
CREATE TYPE "DiscoveryKind" AS ENUM ('artist', 'album');

-- CreateEnum
CREATE TYPE "SuggestionStatus" AS ENUM ('pending', 'followed', 'wanted', 'dismissed');

-- AlterTable
ALTER TABLE "WatchedArtist" ADD COLUMN     "lastDiscoveredAt" TIMESTAMP(3);

-- CreateTable
CREATE TABLE "DiscoverySuggestion" (
    "id" TEXT NOT NULL,
    "kind" "DiscoveryKind" NOT NULL,
    "artistMbid" TEXT NOT NULL,
    "artistName" TEXT NOT NULL,
    "rgMbid" TEXT,
    "album" TEXT,
    "primaryType" TEXT,
    "secondaryTypes" TEXT[],
    "firstReleaseDate" TEXT,
    "score" DOUBLE PRECISION NOT NULL,
    "seedCount" INTEGER NOT NULL,
    "sources" TEXT[],
    "status" "SuggestionStatus" NOT NULL DEFAULT 'pending',
    "dedupeKey" TEXT NOT NULL,
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" TIMESTAMP(3) NOT NULL,

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

-- CreateIndex
CREATE UNIQUE INDEX "DiscoverySuggestion_dedupeKey_key" ON "DiscoverySuggestion"("dedupeKey");
