-- CreateEnum
CREATE TYPE "ExcludeType" AS ENUM ('ROLE', 'USER');

-- CreateTable
CREATE TABLE "AutoRoleConfig" (
    "guildId" TEXT NOT NULL,
    "userRoleId" TEXT,
    "botRoleId" TEXT,
    "isEnabled" BOOLEAN NOT NULL DEFAULT false,
    "botEnabled" BOOLEAN NOT NULL DEFAULT false,
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" TIMESTAMP(3) NOT NULL,

    CONSTRAINT "AutoRoleConfig_pkey" PRIMARY KEY ("guildId")
);

-- CreateTable
CREATE TABLE "AutoRoleExclude" (
    "id" TEXT NOT NULL,
    "guildId" TEXT NOT NULL,
    "targetId" TEXT NOT NULL,
    "type" "ExcludeType" NOT NULL,
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,

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

-- CreateIndex
CREATE UNIQUE INDEX "AutoRoleExclude_guildId_targetId_type_key" ON "AutoRoleExclude"("guildId", "targetId", "type");
