Skip to content

Commit

Permalink
add default counts to stats
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcasey committed Oct 24, 2024
1 parent daf9cc0 commit 0484213
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- AlterTable
ALTER TABLE "UserAllTimeStats" ALTER COLUMN "pointsEarnedAsBuilder" SET DEFAULT 0,
ALTER COLUMN "pointsEarnedAsScout" SET DEFAULT 0;

-- AlterTable
ALTER TABLE "UserSeasonStats" ALTER COLUMN "pointsEarnedAsBuilder" SET DEFAULT 0,
ALTER COLUMN "pointsEarnedAsScout" SET DEFAULT 0,
ALTER COLUMN "nftOwners" SET DEFAULT 0,
ALTER COLUMN "nftsSold" SET DEFAULT 0;
12 changes: 6 additions & 6 deletions src/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -3020,12 +3020,12 @@ model UserSeasonStats {
lastUpdated DateTime @default(now())
userId String @db.Uuid
user Scout @relation(fields: [userId], references: [id], onDelete: Cascade)
pointsEarnedAsBuilder Int
pointsEarnedAsScout Int
pointsEarnedAsBuilder Int @default(0)
pointsEarnedAsScout Int @default(0)
season String
// Optional int as not all users have a builder nft to sell
nftOwners Int?
nftsSold Int?
nftOwners Int? @default(0)
nftsSold Int? @default(0)
nftsPurchased Int @default(0)
@@unique([userId, season])
Expand All @@ -3036,8 +3036,8 @@ model UserAllTimeStats {
lastUpdated DateTime @default(now())
userId String @unique @db.Uuid
user Scout @relation(fields: [userId], references: [id], onDelete: Cascade)
pointsEarnedAsBuilder Int
pointsEarnedAsScout Int
pointsEarnedAsBuilder Int @default(0)
pointsEarnedAsScout Int @default(0)
@@index([userId])
}
Expand Down

0 comments on commit 0484213

Please sign in to comment.