From 050cfacec30a7c960fe9c88530a42f2fa8b627a3 Mon Sep 17 00:00:00 2001 From: hailin Date: Tue, 23 Dec 2025 08:02:21 -0800 Subject: [PATCH] =?UTF-8?q?fix(authorization):=20=E5=A2=9E=E5=A4=A7=20mont?= =?UTF-8?q?hly=5Fassessments.local=5Fpercentage=20=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=B2=BE=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将 local_percentage 字段从 DECIMAL(5,2) 改为 DECIMAL(10,2) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../migration.sql | 4 ++++ backend/services/authorization-service/prisma/schema.prisma | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 backend/services/authorization-service/prisma/migrations/20251223000001_increase_local_percentage_precision/migration.sql diff --git a/backend/services/authorization-service/prisma/migrations/20251223000001_increase_local_percentage_precision/migration.sql b/backend/services/authorization-service/prisma/migrations/20251223000001_increase_local_percentage_precision/migration.sql new file mode 100644 index 00000000..d779d6cb --- /dev/null +++ b/backend/services/authorization-service/prisma/migrations/20251223000001_increase_local_percentage_precision/migration.sql @@ -0,0 +1,4 @@ +-- AlterTable: Increase local_percentage precision from DECIMAL(5,2) to DECIMAL(10,2) +-- This allows storing percentages greater than 999.99% + +ALTER TABLE "monthly_assessments" ALTER COLUMN "local_percentage" TYPE DECIMAL(10, 2); diff --git a/backend/services/authorization-service/prisma/schema.prisma b/backend/services/authorization-service/prisma/schema.prisma index e982b780..1911711d 100644 --- a/backend/services/authorization-service/prisma/schema.prisma +++ b/backend/services/authorization-service/prisma/schema.prisma @@ -98,7 +98,7 @@ model MonthlyAssessment { // 自有团队占比 localTeamCount Int @default(0) @map("local_team_count") totalTeamCount Int @default(0) @map("total_team_count") - localPercentage Decimal @default(0) @map("local_percentage") @db.Decimal(5, 2) + localPercentage Decimal @default(0) @map("local_percentage") @db.Decimal(10, 2) localPercentagePass Boolean @default(false) @map("local_percentage_pass") // 超越目标占比