Files
stats/packages/db/prisma/migrations/20250127054047_bot_events_buffer/migration.sql
Carl-Gerhard Lindesvärd 71bf22af51 feature(queue): use postgres instead of redis for buffer
* wip(buffer): initial implementation of psql buffer

* wip(buffer): add both profile and bots buffer
2025-01-30 22:50:57 +00:00

18 lines
541 B
SQL

-- CreateTable
CREATE TABLE "bot_event_buffer" (
"id" TEXT NOT NULL,
"projectId" TEXT NOT NULL,
"eventId" TEXT NOT NULL,
"payload" JSONB NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"processedAt" TIMESTAMP(3),
CONSTRAINT "bot_event_buffer_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE INDEX "bot_event_buffer_processedAt_idx" ON "bot_event_buffer"("processedAt");
-- CreateIndex
CREATE INDEX "bot_event_buffer_projectId_eventId_idx" ON "bot_event_buffer"("projectId", "eventId");