-- CreateTable
CREATE TABLE "platform_meeting_attendance"."meeting_series_attendee_exceptions" (
    "series_id" VARCHAR(32) NOT NULL,
    "user_id" UUID NOT NULL,
    "excluded_by" UUID NOT NULL,
    "excluded_at" TIMESTAMPTZ(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "reason" VARCHAR(500),

    CONSTRAINT "meeting_series_attendee_exceptions_pkey" PRIMARY KEY ("series_id","user_id")
);

-- CreateIndex
CREATE INDEX "meeting_series_attendee_exceptions_user_id_idx" ON "platform_meeting_attendance"."meeting_series_attendee_exceptions"("user_id");

-- AddForeignKey
ALTER TABLE "platform_meeting_attendance"."meeting_series_attendee_exceptions" ADD CONSTRAINT "meeting_series_attendee_exceptions_series_id_fkey" FOREIGN KEY ("series_id") REFERENCES "platform_meeting_attendance"."meeting_series"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "platform_meeting_attendance"."meeting_series_attendee_exceptions" ADD CONSTRAINT "meeting_series_attendee_exceptions_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "platform_iam"."users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
