This commit is contained in:
Carl-Gerhard Lindesvärd
2026-02-18 18:28:23 +01:00
parent d1b39c4c93
commit 765e4aa107
24 changed files with 1332 additions and 200 deletions

View File

@@ -0,0 +1,15 @@
-- CreateTable
CREATE TABLE "public"."groups" (
"id" TEXT NOT NULL DEFAULT '',
"projectId" TEXT NOT NULL,
"type" TEXT NOT NULL,
"name" TEXT NOT NULL,
"properties" JSONB NOT NULL DEFAULT '{}',
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "groups_pkey" PRIMARY KEY ("projectId","id")
);
-- AddForeignKey
ALTER TABLE "public"."groups" ADD CONSTRAINT "groups_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "public"."projects"("id") ON DELETE CASCADE ON UPDATE CASCADE;

View File

@@ -199,6 +199,7 @@ model Project {
meta EventMeta[]
references Reference[]
access ProjectAccess[]
groups Group[]
notificationRules NotificationRule[]
notifications Notification[]
@@ -215,6 +216,20 @@ model Project {
@@map("projects")
}
model Group {
id String @default("")
projectId String
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
type String
name String
properties Json @default("{}")
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
@@id([projectId, id])
@@map("groups")
}
enum AccessLevel {
read
write