feat: create ViewField model (#961)

* feat: create ViewField model

- Created ViewField prisma model
- Added ViewField server resolvers for findMany/updateOne
- Added getViewFields/updateViewField graphql queries

Closes #849

* chore: update node version in .nvmrc files
This commit is contained in:
Thaïs
2023-07-27 18:12:26 +02:00
committed by GitHub
parent e90f44bbfb
commit 9027406fdf
17 changed files with 512 additions and 3 deletions

View File

@ -0,0 +1,15 @@
-- CreateTable
CREATE TABLE "viewFields" (
"id" TEXT NOT NULL,
"fieldName" TEXT NOT NULL,
"index" INTEGER NOT NULL,
"isVisible" BOOLEAN NOT NULL,
"objectName" TEXT NOT NULL,
"sizeInPx" INTEGER NOT NULL,
"workspaceId" TEXT NOT NULL,
CONSTRAINT "viewFields_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "viewFields" ADD CONSTRAINT "viewFields_workspaceId_fkey" FOREIGN KEY ("workspaceId") REFERENCES "workspaces"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

View File

@ -169,6 +169,7 @@ model Workspace {
pipelines Pipeline[]
pipelineStages PipelineStage[]
pipelineProgresses PipelineProgress[]
viewFields ViewField[]
/// @TypeGraphQL.omit(input: true, output: true)
deletedAt DateTime?
@ -532,3 +533,22 @@ model Attachment {
@@map("attachments")
}
model ViewField {
/// @Validator.IsString()
/// @Validator.IsOptional()
id String @id @default(uuid())
fieldName String
index Int
isVisible Boolean
objectName String
sizeInPx Int
/// @TypeGraphQL.omit(input: true, output: true)
workspace Workspace @relation(fields: [workspaceId], references: [id])
/// @TypeGraphQL.omit(input: true, output: true)
workspaceId String
@@map("viewFields")
}