Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added proposal my work column model #375

Merged
merged 4 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@charmverse/core",
"version": "0.88.6",
"version": "0.88.7-rc-feat-my-work-co.1",
"description": "Core API for Charmverse",
"type": "commonjs",
"types": "./dist/cjs/index.d.ts",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-- CreateTable
CREATE TABLE "ProposalMyWorkColumn" (
"spaceId" UUID NOT NULL,
"formFieldId" UUID NOT NULL
);

-- CreateIndex
CREATE UNIQUE INDEX "ProposalMyWorkColumn_spaceId_formFieldId_key" ON "ProposalMyWorkColumn"("spaceId", "formFieldId");

-- AddForeignKey
ALTER TABLE "ProposalMyWorkColumn" ADD CONSTRAINT "ProposalMyWorkColumn_spaceId_fkey" FOREIGN KEY ("spaceId") REFERENCES "Space"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "ProposalMyWorkColumn" ADD CONSTRAINT "ProposalMyWorkColumn_formFieldId_fkey" FOREIGN KEY ("formFieldId") REFERENCES "FormField"("id") ON DELETE CASCADE ON UPDATE CASCADE;
35 changes: 23 additions & 12 deletions src/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ model Space {
docusignCredentials DocusignCredential[]
documentsToSign DocumentToSign[]
docusignAllowedRoleOrUsers DocusignAllowedRoleOrUser[]
proposalMyTaskColumns ProposalMyWorkColumn[]

@@index([createdBy])
}
Expand Down Expand Up @@ -2117,18 +2118,19 @@ enum FormFieldType {
}

model FormField {
id String @id @default(uuid()) @db.Uuid
type FormFieldType
index Int @default(-1)
name String
description Json?
required Boolean @default(false)
private Boolean @default(false)
options Json?
formId String @db.Uuid
form Form @relation(fields: [formId], references: [id], onDelete: Cascade)
fieldConfig Json?
answers FormFieldAnswer[]
id String @id @default(uuid()) @db.Uuid
type FormFieldType
index Int @default(-1)
name String
description Json?
required Boolean @default(false)
private Boolean @default(false)
options Json?
formId String @db.Uuid
form Form @relation(fields: [formId], references: [id], onDelete: Cascade)
fieldConfig Json?
answers FormFieldAnswer[]
proposalMyTaskColumns ProposalMyWorkColumn[]

@@index([formId])
}
Expand Down Expand Up @@ -3143,3 +3145,12 @@ model PendingNftTransaction {
@@index([userId])
@@index([status])
}

model ProposalMyWorkColumn {
spaceId String @db.Uuid
space Space @relation(fields: [spaceId], references: [id], onDelete: Cascade)
formFieldId String @db.Uuid
formField FormField @relation(fields: [formFieldId], references: [id], onDelete: Cascade)

@@unique([spaceId, formFieldId])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should just be spaceId, since we don't query by formFieldId

}