From 17d72c85648772a2c4694dfbd484284f0c6f5991 Mon Sep 17 00:00:00 2001 From: Gao Sun Date: Mon, 5 Jun 2023 12:51:35 +0800 Subject: [PATCH] refactor(core): refine query --- packages/core/src/queries/resource.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/queries/resource.ts b/packages/core/src/queries/resource.ts index 1fe69be4b..96f7b969c 100644 --- a/packages/core/src/queries/resource.ts +++ b/packages/core/src/queries/resource.ts @@ -38,7 +38,7 @@ export const createResourceQueries = (pool: CommonQueryMethods) => { await connection.query(sql` update ${table} set ${fields.isDefault}=false - where ${fields.id}!=${id}; + where ${fields.isDefault}=true; `); const returning = await connection.maybeOne(sql` update ${table}