From 2b53995f1b69087468880256e04dbf6aa72b2377 Mon Sep 17 00:00:00 2001 From: Jasper Mayone Date: Wed, 17 Jul 2024 17:28:00 -0400 Subject: [PATCH] hotfix 2 --- .../20240717212750_fix_errors/migration.sql | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 prisma/migrations/20240717212750_fix_errors/migration.sql diff --git a/prisma/migrations/20240717212750_fix_errors/migration.sql b/prisma/migrations/20240717212750_fix_errors/migration.sql new file mode 100644 index 0000000..d65a150 --- /dev/null +++ b/prisma/migrations/20240717212750_fix_errors/migration.sql @@ -0,0 +1,20 @@ +-- AlterTable +ALTER TABLE "Message" ADD COLUMN "threadId" TEXT; + +-- CreateTable +CREATE TABLE "Thread" ( + "id" TEXT NOT NULL, + "ts" TEXT NOT NULL, + "messageId" TEXT NOT NULL, + + CONSTRAINT "Thread_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE UNIQUE INDEX "Thread_id_key" ON "Thread"("id"); + +-- CreateIndex +CREATE UNIQUE INDEX "Thread_ts_key" ON "Thread"("ts"); + +-- AddForeignKey +ALTER TABLE "Message" ADD CONSTRAINT "Message_threadId_fkey" FOREIGN KEY ("threadId") REFERENCES "Thread"("id") ON DELETE SET NULL ON UPDATE CASCADE;