Skip to content

Commit

Permalink
relate nft purchase events to scout wallet instead
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcasey committed Oct 31, 2024
1 parent 259d0df commit 533043c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE "NFTPurchaseEvent" ADD COLUMN "walletAddress" TEXT;

-- AddForeignKey
ALTER TABLE "NFTPurchaseEvent" ADD CONSTRAINT "NFTPurchaseEvent_walletAddress_fkey" FOREIGN KEY ("walletAddress") REFERENCES "ScoutWallet"("address") ON DELETE CASCADE ON UPDATE CASCADE;
11 changes: 7 additions & 4 deletions src/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -2948,6 +2948,8 @@ model NFTPurchaseEvent {
txHash String
builderEvent BuilderEvent?
activities ScoutGameActivity[]
walletAddress String?
scoutWallet ScoutWallet? @relation(fields: [walletAddress], references: [address], onDelete: Cascade)
@@index([scoutId])
}
Expand Down Expand Up @@ -3167,10 +3169,11 @@ model BuilderCardActivity {
}

model ScoutWallet {
createdAt DateTime @default(now())
address String @unique
scoutId String @db.Uuid
scout Scout @relation(fields: [scoutId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now())
address String @unique
scoutId String @db.Uuid
scout Scout @relation(fields: [scoutId], references: [id], onDelete: Cascade)
purchaseEvents NFTPurchaseEvent[]
@@index([address])
@@index([scoutId])
Expand Down

0 comments on commit 533043c

Please sign in to comment.