Skip to content

Commit

Permalink
add default counts to stats (#378)
Browse files Browse the repository at this point in the history
* add default counts to stats

* ci: version bump to 0.89.2-rc-default-0.0

---------

Co-authored-by: Automated Version Bump <[email protected]>
  • Loading branch information
mattcasey and Automated Version Bump authored Oct 25, 2024
1 parent daf9cc0 commit 1c512ee
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@charmverse/core",
"version": "0.89.1",
"version": "0.89.2-rc-default-0.0",
"description": "Core API for Charmverse",
"type": "commonjs",
"types": "./dist/cjs/index.d.ts",
Expand Down
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 1c512ee

Please sign in to comment.