From c61f1d874c6bebd3d5e5498088cf36cc9848a118 Mon Sep 17 00:00:00 2001 From: Safwan Shaheer Date: Thu, 21 Nov 2024 20:07:30 +0600 Subject: [PATCH] Added moxie and talent profile models --- .../migration.sql | 34 +++++++++++++++++++ src/prisma/schema.prisma | 19 +++++++++++ 2 files changed, 53 insertions(+) create mode 100644 src/prisma/migrations/20241121140531_moxie_talent_profile/migration.sql diff --git a/src/prisma/migrations/20241121140531_moxie_talent_profile/migration.sql b/src/prisma/migrations/20241121140531_moxie_talent_profile/migration.sql new file mode 100644 index 00000000..0020e25a --- /dev/null +++ b/src/prisma/migrations/20241121140531_moxie_talent_profile/migration.sql @@ -0,0 +1,34 @@ +-- CreateTable +CREATE TABLE "TalentProfile" ( + "id" INTEGER NOT NULL, + "score" INTEGER NOT NULL, + "builderId" UUID NOT NULL, + + CONSTRAINT "TalentProfile_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "MoxieProfile" ( + "id" INTEGER NOT NULL, + "builderId" UUID NOT NULL, + + CONSTRAINT "MoxieProfile_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE UNIQUE INDEX "TalentProfile_builderId_key" ON "TalentProfile"("builderId"); + +-- CreateIndex +CREATE INDEX "TalentProfile_builderId_idx" ON "TalentProfile"("builderId"); + +-- CreateIndex +CREATE UNIQUE INDEX "MoxieProfile_builderId_key" ON "MoxieProfile"("builderId"); + +-- CreateIndex +CREATE INDEX "MoxieProfile_builderId_idx" ON "MoxieProfile"("builderId"); + +-- AddForeignKey +ALTER TABLE "TalentProfile" ADD CONSTRAINT "TalentProfile_builderId_fkey" FOREIGN KEY ("builderId") REFERENCES "Scout"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "MoxieProfile" ADD CONSTRAINT "MoxieProfile_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 3ffff6eb..242e1529 100644 --- a/src/prisma/schema.prisma +++ b/src/prisma/schema.prisma @@ -2829,6 +2829,8 @@ model Scout { dailyClaimStreakEvents ScoutDailyClaimStreakEvent[] referralCode String? @unique referralCodeEvent ReferralCodeEvent[] + talentProfile TalentProfile? + moxieProfile MoxieProfile? @@index([path]) @@index([farcasterId]) @@ -3295,3 +3297,20 @@ model ReferralCodeEvent { @@index([builderEventId]) @@index([refereeId]) } + +model TalentProfile { + id Int @id + score Int + builderId String @unique @db.Uuid + builder Scout @relation(fields: [builderId], references: [id], onDelete: Cascade) + + @@index([builderId]) +} + +model MoxieProfile { + id Int @id // fid + builderId String @unique @db.Uuid + builder Scout @relation(fields: [builderId], references: [id], onDelete: Cascade) + + @@index([builderId]) +}