feat(notifications): added notification system w/ interwoven refactoring

This commit is contained in:
DecDuck
2024-11-16 19:41:19 +11:00
parent 62ea9a116b
commit 6e6f09dba0
22 changed files with 498 additions and 56 deletions

View File

@ -0,0 +1,18 @@
-- CreateTable
CREATE TABLE "Notification" (
"id" TEXT NOT NULL,
"nonce" TEXT,
"userId" TEXT NOT NULL,
"title" TEXT NOT NULL,
"description" TEXT NOT NULL,
"actions" TEXT[],
"read" BOOLEAN NOT NULL DEFAULT false,
CONSTRAINT "Notification_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "Notification_nonce_key" ON "Notification"("nonce");
-- AddForeignKey
ALTER TABLE "Notification" ADD CONSTRAINT "Notification_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

View File

@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Notification" ADD COLUMN "created" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;