From f70347cb84b55eabc9c6e096d71c98946577e676 Mon Sep 17 00:00:00 2001 From: Safwan Shaheer Date: Wed, 9 Oct 2024 10:21:18 +0600 Subject: [PATCH 1/4] Added proposal my work column model --- .../migration.sql | 14 ++++++++ src/prisma/schema.prisma | 35 ++++++++++++------- 2 files changed, 37 insertions(+), 12 deletions(-) create mode 100644 src/prisma/migrations/20241009042016_proposal_my_task_column/migration.sql diff --git a/src/prisma/migrations/20241009042016_proposal_my_task_column/migration.sql b/src/prisma/migrations/20241009042016_proposal_my_task_column/migration.sql new file mode 100644 index 00000000..14b361bf --- /dev/null +++ b/src/prisma/migrations/20241009042016_proposal_my_task_column/migration.sql @@ -0,0 +1,14 @@ +-- CreateTable +CREATE TABLE "ProposalMyTaskColumn" ( + "spaceId" UUID NOT NULL, + "formFieldId" UUID NOT NULL +); + +-- CreateIndex +CREATE UNIQUE INDEX "ProposalMyTaskColumn_spaceId_formFieldId_key" ON "ProposalMyTaskColumn"("spaceId", "formFieldId"); + +-- AddForeignKey +ALTER TABLE "ProposalMyTaskColumn" ADD CONSTRAINT "ProposalMyTaskColumn_spaceId_fkey" FOREIGN KEY ("spaceId") REFERENCES "Space"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ProposalMyTaskColumn" ADD CONSTRAINT "ProposalMyTaskColumn_formFieldId_fkey" FOREIGN KEY ("formFieldId") REFERENCES "FormField"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/src/prisma/schema.prisma b/src/prisma/schema.prisma index 34b1af3f..ff018793 100644 --- a/src/prisma/schema.prisma +++ b/src/prisma/schema.prisma @@ -385,6 +385,7 @@ model Space { docusignCredentials DocusignCredential[] documentsToSign DocumentToSign[] docusignAllowedRoleOrUsers DocusignAllowedRoleOrUser[] + proposalMyTaskColumns ProposalMyTaskColumn[] @@index([createdBy]) } @@ -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 ProposalMyTaskColumn[] @@index([formId]) } @@ -3143,3 +3145,12 @@ model PendingNftTransaction { @@index([userId]) @@index([status]) } + +model ProposalMyTaskColumn { + 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]) +} From 2ecd086d2826126606e73ca067e91811968e62ff Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Wed, 9 Oct 2024 04:22:53 +0000 Subject: [PATCH 2/4] ci: version bump to 0.88.7-rc-feat-my-work-co.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 90fb7812..5f72dd5e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@charmverse/core", - "version": "0.88.6", + "version": "0.88.7-rc-feat-my-work-co.0", "description": "Core API for Charmverse", "type": "commonjs", "types": "./dist/cjs/index.d.ts", From ff80a29bbcfda4a6afde3132b6961021fa4a7ccf Mon Sep 17 00:00:00 2001 From: Safwan Shaheer Date: Thu, 10 Oct 2024 17:28:40 +0600 Subject: [PATCH 3/4] Renamed column --- .../migration.sql | 8 ++++---- src/prisma/schema.prisma | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) rename src/prisma/migrations/{20241009042016_proposal_my_task_column => 20241010112627_proposal_my_work_column}/migration.sql (55%) diff --git a/src/prisma/migrations/20241009042016_proposal_my_task_column/migration.sql b/src/prisma/migrations/20241010112627_proposal_my_work_column/migration.sql similarity index 55% rename from src/prisma/migrations/20241009042016_proposal_my_task_column/migration.sql rename to src/prisma/migrations/20241010112627_proposal_my_work_column/migration.sql index 14b361bf..959cfb99 100644 --- a/src/prisma/migrations/20241009042016_proposal_my_task_column/migration.sql +++ b/src/prisma/migrations/20241010112627_proposal_my_work_column/migration.sql @@ -1,14 +1,14 @@ -- CreateTable -CREATE TABLE "ProposalMyTaskColumn" ( +CREATE TABLE "ProposalMyWorkColumn" ( "spaceId" UUID NOT NULL, "formFieldId" UUID NOT NULL ); -- CreateIndex -CREATE UNIQUE INDEX "ProposalMyTaskColumn_spaceId_formFieldId_key" ON "ProposalMyTaskColumn"("spaceId", "formFieldId"); +CREATE UNIQUE INDEX "ProposalMyWorkColumn_spaceId_formFieldId_key" ON "ProposalMyWorkColumn"("spaceId", "formFieldId"); -- AddForeignKey -ALTER TABLE "ProposalMyTaskColumn" ADD CONSTRAINT "ProposalMyTaskColumn_spaceId_fkey" FOREIGN KEY ("spaceId") REFERENCES "Space"("id") ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE "ProposalMyWorkColumn" ADD CONSTRAINT "ProposalMyWorkColumn_spaceId_fkey" FOREIGN KEY ("spaceId") REFERENCES "Space"("id") ON DELETE CASCADE ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "ProposalMyTaskColumn" ADD CONSTRAINT "ProposalMyTaskColumn_formFieldId_fkey" FOREIGN KEY ("formFieldId") REFERENCES "FormField"("id") ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE "ProposalMyWorkColumn" ADD CONSTRAINT "ProposalMyWorkColumn_formFieldId_fkey" FOREIGN KEY ("formFieldId") REFERENCES "FormField"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/src/prisma/schema.prisma b/src/prisma/schema.prisma index ff018793..c2a71565 100644 --- a/src/prisma/schema.prisma +++ b/src/prisma/schema.prisma @@ -385,7 +385,7 @@ model Space { docusignCredentials DocusignCredential[] documentsToSign DocumentToSign[] docusignAllowedRoleOrUsers DocusignAllowedRoleOrUser[] - proposalMyTaskColumns ProposalMyTaskColumn[] + proposalMyTaskColumns ProposalMyWorkColumn[] @@index([createdBy]) } @@ -2130,7 +2130,7 @@ model FormField { form Form @relation(fields: [formId], references: [id], onDelete: Cascade) fieldConfig Json? answers FormFieldAnswer[] - proposalMyTaskColumns ProposalMyTaskColumn[] + proposalMyTaskColumns ProposalMyWorkColumn[] @@index([formId]) } @@ -3146,7 +3146,7 @@ model PendingNftTransaction { @@index([status]) } -model ProposalMyTaskColumn { +model ProposalMyWorkColumn { spaceId String @db.Uuid space Space @relation(fields: [spaceId], references: [id], onDelete: Cascade) formFieldId String @db.Uuid From e5198d456e9549cdb002b109a5f7215defd3077f Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Thu, 10 Oct 2024 11:30:09 +0000 Subject: [PATCH 4/4] ci: version bump to 0.88.7-rc-feat-my-work-co.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5f72dd5e..2a23751c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@charmverse/core", - "version": "0.88.7-rc-feat-my-work-co.0", + "version": "0.88.7-rc-feat-my-work-co.1", "description": "Core API for Charmverse", "type": "commonjs", "types": "./dist/cjs/index.d.ts",