From f5aa86beaceac3145a9a1e8b16d79b666dd151db Mon Sep 17 00:00:00 2001 From: mattcasey Date: Fri, 6 Dec 2024 10:58:51 -0700 Subject: [PATCH 1/2] add partner reward --- .../migration.sql | 18 ++++++++++++++++++ src/prisma/schema.prisma | 16 +++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/prisma/migrations/20241206175837_add_partner_bonus/migration.sql diff --git a/src/prisma/migrations/20241206175837_add_partner_bonus/migration.sql b/src/prisma/migrations/20241206175837_add_partner_bonus/migration.sql new file mode 100644 index 00000000..37d83648 --- /dev/null +++ b/src/prisma/migrations/20241206175837_add_partner_bonus/migration.sql @@ -0,0 +1,18 @@ +-- CreateTable +CREATE TABLE "PartnerRewardEvent" ( + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "week" TEXT NOT NULL, + "season" TEXT NOT NULL, + "userId" UUID NOT NULL, + "partner" TEXT NOT NULL, + "reward" JSONB NOT NULL +); + +-- CreateIndex +CREATE INDEX "PartnerRewardEvent_userId_idx" ON "PartnerRewardEvent"("userId"); + +-- CreateIndex +CREATE UNIQUE INDEX "PartnerRewardEvent_userId_partner_week_season_key" ON "PartnerRewardEvent"("userId", "partner", "week", "season"); + +-- AddForeignKey +ALTER TABLE "PartnerRewardEvent" ADD CONSTRAINT "PartnerRewardEvent_userId_fkey" FOREIGN KEY ("userId") REFERENCES "Scout"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/src/prisma/schema.prisma b/src/prisma/schema.prisma index 53d46443..4f7dd37e 100644 --- a/src/prisma/schema.prisma +++ b/src/prisma/schema.prisma @@ -2838,6 +2838,7 @@ model Scout { talentProfile TalentProfile? mergedFromEvents ScoutMergeEvent[] @relation("mergedFromScout") mergedToEvents ScoutMergeEvent[] @relation("mergedToScout") + PartnerRewardEvent PartnerRewardEvent[] @@index([path]) @@index([farcasterId]) @@ -3115,7 +3116,7 @@ model BuilderNft { builder Scout @relation(fields: [builderId], references: [id], onDelete: Cascade) chainId Int season String - nftType BuilderNftType @default(default) + nftType BuilderNftType @default(default) currentPrice BigInt contractAddress String tokenId Int @@ -3342,3 +3343,16 @@ model TalentProfile { @@index([builderId]) } + +model PartnerRewardEvent { + createdAt DateTime @default(now()) + week String + season String + userId String @db.Uuid + user Scout @relation(fields: [userId], references: [id], onDelete: Cascade) + partner String + reward Json + + @@unique([userId, partner, week, season]) + @@index([userId]) +} From ea3e5d1a35decbc52a760d2f3073870724757e04 Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Fri, 6 Dec 2024 18:01:53 +0000 Subject: [PATCH 2/2] ci: version bump to 0.98.4-rc-store-moxie.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7bd12f37..d988ce9b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@charmverse/core", - "version": "0.98.3", + "version": "0.98.4-rc-store-moxie.0", "description": "Core API for Charmverse", "type": "commonjs", "types": "./dist/cjs/index.d.ts",