From ba17aae706e8d19c70a3f7c9fd0d09c876bb164d Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Tue, 25 Mar 2025 15:29:41 -0500 Subject: [PATCH] feat: bump int size --- docs/changelogs/1.27.3.md | 9 +++++++++ package.json | 2 +- .../src/core/blitzkit/getBlitzFromDiscord.ts | 6 ++++-- prisma/schema.prisma | 19 +++---------------- 4 files changed, 17 insertions(+), 19 deletions(-) create mode 100644 docs/changelogs/1.27.3.md diff --git a/docs/changelogs/1.27.3.md b/docs/changelogs/1.27.3.md new file mode 100644 index 000000000..73c49da1e --- /dev/null +++ b/docs/changelogs/1.27.3.md @@ -0,0 +1,9 @@ +# BlitzKit 1.27.3 + +This update only affects the bot. + +## Fixes + +- Added support for 64-bit IDs allowing users with new accounts to link with BlitzKit + - This comes at the added cost of resetting the links of all other accounts + - Just re-link and you're good to go diff --git a/package.json b/package.json index 270773745..649b22a3c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "blitzkit", "private": true, - "version": "1.27.2", + "version": "1.27.3", "description": "🎉 Tools for everything World of Tanks Blitz", "type": "module", "types": "./types.d.ts", diff --git a/packages/bot/src/core/blitzkit/getBlitzFromDiscord.ts b/packages/bot/src/core/blitzkit/getBlitzFromDiscord.ts index 4821d1291..4bb31df02 100644 --- a/packages/bot/src/core/blitzkit/getBlitzFromDiscord.ts +++ b/packages/bot/src/core/blitzkit/getBlitzFromDiscord.ts @@ -8,6 +8,8 @@ export async function getBlitzFromDiscord(discordId: bigint) { if (unique === null) return null; - await flagUserActivity(unique.blitz_id); - return { id: unique.blitz_id, region: idToRegion(unique.blitz_id) }; + const id = Number(unique.blitz_id); + + await flagUserActivity(id); + return { id, region: idToRegion(id) }; } diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 2d169b953..f4bced458 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -9,28 +9,15 @@ datasource db { } model User { - blitz_id Int @id @map("blitz") // map: "blitz" was too vague - last_used DateTime? @default(now()) - tank_votes TankVote[] + blitz_id BigInt @id @map("blitz") // map: "blitz" was too vague + last_used DateTime? @default(now()) @@map("Users") // map: "Users" was mistakenly plural } -model TankVote { - id Int @id - last_updated DateTime @default(now()) - easiness Int? - firepower Int? - maneuverability Int? - survivability Int? - - user User @relation(fields: [user_blitz_id], references: [blitz_id]) - user_blitz_id Int -} - model DiscordUser { discord_id BigInt @id @map("discord") // map: "discord" was too vague - blitz_id Int @map("blitz") // map: "blitz" was too vague + blitz_id BigInt @map("blitz") // map: "blitz" was too vague @@map("DiscordUsers") // map: "DiscordUsers" was mistakenly plural }