Update docs; Add invites to db

This commit is contained in:
Aslan 2025-12-24 13:09:33 +01:00
parent 4f08e4d57f
commit 2fc0f9c404
4 changed files with 70 additions and 34 deletions

View file

@ -0,0 +1,17 @@
-- CreateTable
CREATE TABLE "Invite" (
"id" TEXT NOT NULL,
"communityId" TEXT,
"totalInvites" INTEGER NOT NULL DEFAULT 0,
"remainingInvites" INTEGER NOT NULL DEFAULT 0,
"creationDate" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"expirationDate" TIMESTAMP(3),
CONSTRAINT "Invite_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "Invite_id_key" ON "Invite"("id");
-- AddForeignKey
ALTER TABLE "Invite" ADD CONSTRAINT "Invite_communityId_fkey" FOREIGN KEY ("communityId") REFERENCES "Community"("id") ON DELETE SET NULL ON UPDATE CASCADE;