-- CreateTable
CREATE TABLE "platform_meeting_attendance"."outlook_series_occurrence_exclusions" (
    "id" VARCHAR(32) NOT NULL,
    "binding_id" VARCHAR(32) NOT NULL,
    "occurrence_graph_event_id" VARCHAR(255) NOT NULL,
    "ical_uid" VARCHAR(255),
    "reason" VARCHAR(255),
    "created_by_email" VARCHAR(255),
    "created_at" TIMESTAMPTZ(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updated_at" TIMESTAMPTZ(3) NOT NULL,

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

-- CreateIndex
CREATE UNIQUE INDEX "outlook_series_occurrence_exclusions_binding_id_occurrence_graph_event_id_key" ON "platform_meeting_attendance"."outlook_series_occurrence_exclusions"("binding_id", "occurrence_graph_event_id");

-- CreateIndex
CREATE INDEX "outlook_series_occurrence_exclusions_occurrence_graph_event_id_idx" ON "platform_meeting_attendance"."outlook_series_occurrence_exclusions"("occurrence_graph_event_id");

-- CreateIndex
CREATE INDEX "outlook_series_occurrence_exclusions_created_at_idx" ON "platform_meeting_attendance"."outlook_series_occurrence_exclusions"("created_at");

-- AddForeignKey
ALTER TABLE "platform_meeting_attendance"."outlook_series_occurrence_exclusions" ADD CONSTRAINT "outlook_series_occurrence_exclusions_binding_id_fkey" FOREIGN KEY ("binding_id") REFERENCES "platform_meeting_attendance"."outlook_sync_bindings"("id") ON DELETE CASCADE ON UPDATE CASCADE;
