From 0f0a5cb65a3920eae5be35a9c336388e0a852aa4 Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Thu, 6 Aug 2026 21:11:44 -0600 Subject: [PATCH] =?UTF-8?q?fix(=E9=98=B6=E6=AE=B51):=20=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=20problem=20=E4=B8=BB=E9=94=AE=E4=B8=8E=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E7=BC=96=E5=8F=B7=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/api/src/db/schema.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/api/src/db/schema.ts b/apps/api/src/db/schema.ts index 93a3214..ca640b9 100644 --- a/apps/api/src/db/schema.ts +++ b/apps/api/src/db/schema.ts @@ -383,7 +383,7 @@ export const problem = pgTable("problem", { // You can use { mode: "bigint" } if numbers are exceeding js number limitations acceptedNumber: bigint("accepted_number", { mode: "number" }).default(0).notNull(), createdById: integer("created_by_id").notNull(), - id: text("_id").notNull(), + displayId: text("_id").notNull(), statisticInfo: jsonb("statistic_info").default({}).notNull(), contestId: integer("contest_id"), isPublic: boolean("is_public").default(false).notNull(), @@ -399,7 +399,7 @@ export const problem = pgTable("problem", { sqlConfig: jsonb("sql_config"), sqlDisplay: jsonb("sql_display"), }, (table) => [ - index("problem__id_919b1d80").using("btree", table.id.asc().nullsLast().op("text_ops")), + index("problem__id_919b1d80").using("btree", table.displayId.asc().nullsLast().op("text_ops")), index("problem_contest_id_328e013a").using("btree", table.contestId.asc().nullsLast().op("int4_ops")), index("problem_contest_visible_idx").using("btree", table.contestId.asc().nullsLast().op("bool_ops"), table.visible.asc().nullsLast().op("int4_ops")), index("problem_created_by_id_cb362143").using("btree", table.createdById.asc().nullsLast().op("int4_ops")), @@ -414,7 +414,7 @@ export const problem = pgTable("problem", { foreignColumns: [user.id], name: "problem_created_by_id_cb362143_fk_user_id" }), - unique("unique_problem_id_contest").on(table.id, table.contestId), + unique("unique_problem_id_contest").on(table.displayId, table.contestId), ]); export const problemTags = pgTable("problem_tags", {