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") // 超越目标占比