From 67909f1fa5cd3c896e52a0890c9269c0c5fd8155 Mon Sep 17 00:00:00 2001 From: Safwan Shaheer Date: Sat, 26 Oct 2024 02:47:13 +0600 Subject: [PATCH] Builder card activity schema (#379) * Builder card activity schema * ci: version bump to 0.89.3-rc-feat-builder-ac.0 * add unique to builder * ci: version bump to 0.89.4-rc-feat-builder-ac.0 --------- Co-authored-by: Automated Version Bump Co-authored-by: mattcasey --- package.json | 2 +- .../migration.sql | 13 +++++++++++++ src/prisma/schema.prisma | 9 +++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 src/prisma/migrations/20241025164941_add_builder_activity/migration.sql diff --git a/package.json b/package.json index bb389f93..6c103c4c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@charmverse/core", - "version": "0.89.3", + "version": "0.89.4-rc-feat-builder-ac.0", "description": "Core API for Charmverse", "type": "commonjs", "types": "./dist/cjs/index.d.ts", diff --git a/src/prisma/migrations/20241025164941_add_builder_activity/migration.sql b/src/prisma/migrations/20241025164941_add_builder_activity/migration.sql new file mode 100644 index 00000000..89e6795f --- /dev/null +++ b/src/prisma/migrations/20241025164941_add_builder_activity/migration.sql @@ -0,0 +1,13 @@ +-- CreateTable +CREATE TABLE "BuilderCardActivity" ( + "builderId" UUID NOT NULL, + "last7Days" JSONB NOT NULL, + + CONSTRAINT "BuilderCardActivity_pkey" PRIMARY KEY ("builderId") +); + +-- CreateIndex +CREATE UNIQUE INDEX "BuilderCardActivity_builderId_key" ON "BuilderCardActivity"("builderId"); + +-- AddForeignKey +ALTER TABLE "BuilderCardActivity" ADD CONSTRAINT "BuilderCardActivity_builderId_fkey" FOREIGN KEY ("builderId") REFERENCES "Scout"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/src/prisma/schema.prisma b/src/prisma/schema.prisma index bd7d159b..0d8f433d 100644 --- a/src/prisma/schema.prisma +++ b/src/prisma/schema.prisma @@ -2817,6 +2817,7 @@ model Scout { builderNfts BuilderNft[] activities ScoutGameActivity[] PendingNftTransaction PendingNftTransaction[] + builderCardActivities BuilderCardActivity[] @@index([username]) @@index([farcasterId]) @@ -3157,3 +3158,11 @@ model ProposalMyWorkColumn { @@unique([spaceId, formFieldId]) } + +model BuilderCardActivity { + builderId String @id @db.Uuid + builder Scout @relation(fields: [builderId], references: [id], onDelete: Cascade) + last7Days Json + + @@unique([builderId]) +}