diff --git a/package.json b/package.json index 9ca98c9b..2422debe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@charmverse/core", - "version": "0.91.0", + "version": "0.91.1-rc-feat-sg-wallet.1", "description": "Core API for Charmverse", "type": "commonjs", "types": "./dist/cjs/index.d.ts", diff --git a/src/prisma/migrations/20241029150825_scout_wallet_addresses/migration.sql b/src/prisma/migrations/20241029150825_scout_wallet_addresses/migration.sql new file mode 100644 index 00000000..cd293880 --- /dev/null +++ b/src/prisma/migrations/20241029150825_scout_wallet_addresses/migration.sql @@ -0,0 +1,18 @@ +-- CreateTable +CREATE TABLE "ScoutWallet" ( + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "address" TEXT NOT NULL, + "scoutId" UUID NOT NULL +); + +-- CreateIndex +CREATE UNIQUE INDEX "ScoutWallet_address_key" ON "ScoutWallet"("address"); + +-- CreateIndex +CREATE INDEX "ScoutWallet_address_idx" ON "ScoutWallet"("address"); + +-- CreateIndex +CREATE INDEX "ScoutWallet_scoutId_idx" ON "ScoutWallet"("scoutId"); + +-- AddForeignKey +ALTER TABLE "ScoutWallet" ADD CONSTRAINT "ScoutWallet_scoutId_fkey" FOREIGN KEY ("scoutId") REFERENCES "Scout"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/src/prisma/schema.prisma b/src/prisma/schema.prisma index 7b480177..fbe29983 100644 --- a/src/prisma/schema.prisma +++ b/src/prisma/schema.prisma @@ -2805,6 +2805,7 @@ model Scout { agreedToTermsAt DateTime? onboardedAt DateTime? currentBalance Int @default(0) + scoutWallet ScoutWallet[] strikes BuilderStrike[] events BuilderEvent[] githubUser GithubUser[] @@ -3167,3 +3168,13 @@ model BuilderCardActivity { @@unique([builderId]) } + +model ScoutWallet { + createdAt DateTime @default(now()) + address String @unique + scoutId String @db.Uuid + scout Scout @relation(fields: [scoutId], references: [id], onDelete: Cascade) + + @@index([address]) + @@index([scoutId]) +}