diff --git a/backend/services/authorization-service/prisma/migrations/20251223000000_increase_progress_percentage_precision/migration.sql b/backend/services/authorization-service/prisma/migrations/20251223000000_increase_progress_percentage_precision/migration.sql new file mode 100644 index 00000000..2bbeae26 --- /dev/null +++ b/backend/services/authorization-service/prisma/migrations/20251223000000_increase_progress_percentage_precision/migration.sql @@ -0,0 +1,4 @@ +-- AlterTable: Increase progress_percentage precision from DECIMAL(5,2) to DECIMAL(10,2) +-- This allows storing percentages greater than 999.99% (e.g., when cumulative completed far exceeds target) + +ALTER TABLE "stickman_rankings" ALTER COLUMN "progress_percentage" TYPE DECIMAL(10, 2); diff --git a/backend/services/authorization-service/prisma/schema.prisma b/backend/services/authorization-service/prisma/schema.prisma index 3f8d41de..e982b780 100644 --- a/backend/services/authorization-service/prisma/schema.prisma +++ b/backend/services/authorization-service/prisma/schema.prisma @@ -308,7 +308,7 @@ model StickmanRanking { currentMonth String @map("current_month") cumulativeCompleted Int @map("cumulative_completed") cumulativeTarget Int @map("cumulative_target") - progressPercentage Decimal @map("progress_percentage") @db.Decimal(5, 2) + progressPercentage Decimal @map("progress_percentage") @db.Decimal(10, 2) exceedRatio Decimal @map("exceed_ratio") @db.Decimal(10, 4) // 排名