diff --git a/package.json b/package.json index 7452b5f1..5b29c50f 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/prisma/migrations/20241024235208_default_counts/migration.sql b/src/prisma/migrations/20241024235208_default_counts/migration.sql new file mode 100644 index 00000000..afb83a88 --- /dev/null +++ b/src/prisma/migrations/20241024235208_default_counts/migration.sql @@ -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; diff --git a/src/prisma/schema.prisma b/src/prisma/schema.prisma index f0d95bd4..4423c522 100644 --- a/src/prisma/schema.prisma +++ b/src/prisma/schema.prisma @@ -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]) @@ -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]) }