wip event list

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-02-16 23:06:36 +01:00
parent a74acda707
commit 02d52d5da8
27 changed files with 1178 additions and 465 deletions

View File

@@ -0,0 +1,11 @@
/*
Warnings:
- Added the required column `project_id` to the `event_meta` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE "event_meta" ADD COLUMN "project_id" TEXT NOT NULL;
-- AddForeignKey
ALTER TABLE "event_meta" ADD CONSTRAINT "event_meta_project_id_fkey" FOREIGN KEY ("project_id") REFERENCES "projects"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

View File

@@ -0,0 +1,4 @@
-- AlterTable
ALTER TABLE "event_meta" ADD COLUMN "color" TEXT,
ADD COLUMN "icon" TEXT,
ALTER COLUMN "conversion" DROP NOT NULL;

View File

@@ -0,0 +1,8 @@
/*
Warnings:
- A unique constraint covering the columns `[name,project_id]` on the table `event_meta` will be added. If there are existing duplicate values, this will fail.
*/
-- CreateIndex
CREATE UNIQUE INDEX "event_meta_name_project_id_key" ON "event_meta"("name", "project_id");

View File

@@ -24,6 +24,7 @@ model Project {
reports Report[]
dashboards Dashboard[]
share ShareOverview?
EventMeta EventMeta[]
@@map("projects")
}
@@ -169,9 +170,15 @@ model ShareOverview {
model EventMeta {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
name String
conversion Boolean
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
conversion Boolean?
color String?
icon String?
project_id String
project Project @relation(fields: [project_id], references: [id])
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
@@unique([name, project_id])
@@map("event_meta")
}