-- CreateTable
CREATE TABLE "platform_knowledge"."sharepoint_sync_cursors" (
    "id" UUID NOT NULL,
    "drive_id" VARCHAR(255) NOT NULL,
    "scope_path" VARCHAR(500) NOT NULL,
    "delta_link" TEXT NOT NULL,
    "last_synced_at" TIMESTAMPTZ(3),
    "created_at" TIMESTAMPTZ(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updated_at" TIMESTAMPTZ(3) NOT NULL,

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

-- CreateIndex
CREATE INDEX "sharepoint_sync_cursors_drive_id_idx" ON "platform_knowledge"."sharepoint_sync_cursors"("drive_id");

-- CreateIndex
CREATE UNIQUE INDEX "sharepoint_sync_cursors_drive_id_scope_path_key" ON "platform_knowledge"."sharepoint_sync_cursors"("drive_id", "scope_path");
