-- CreateEnum
CREATE TYPE "EventStatus" AS ENUM ('SCHEDULED', 'CANCELLED', 'COMPLETED');

-- CreateTable
CREATE TABLE "GuildEvent" (
    "id" TEXT NOT NULL,
    "guildId" TEXT NOT NULL,
    "title" TEXT NOT NULL,
    "description" TEXT,
    "startsAt" TIMESTAMP(3) NOT NULL,
    "timezone" TEXT NOT NULL DEFAULT 'Asia/Seoul',
    "status" "EventStatus" NOT NULL DEFAULT 'SCHEDULED',
    "announcementChannelId" TEXT,
    "createdByUserId" TEXT NOT NULL,
    "reminderEnabled" BOOLEAN NOT NULL DEFAULT true,
    "remindedOneHour" BOOLEAN NOT NULL DEFAULT false,
    "remindedTenMinutes" BOOLEAN NOT NULL DEFAULT false,
    "announcedAt" TIMESTAMP(3),
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" TIMESTAMP(3) NOT NULL,

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

-- CreateIndex
CREATE INDEX "GuildEvent_guildId_startsAt_idx" ON "GuildEvent"("guildId", "startsAt");

-- CreateIndex
CREATE INDEX "GuildEvent_guildId_status_idx" ON "GuildEvent"("guildId", "status");
