diff --git a/server/src/db/repositories/GoogleApiUsage.repository.ts b/server/src/db/repositories/GoogleApiUsage.repository.ts index 835fe83da..19720f425 100644 --- a/server/src/db/repositories/GoogleApiUsage.repository.ts +++ b/server/src/db/repositories/GoogleApiUsage.repository.ts @@ -43,11 +43,9 @@ export class GoogleApiUsageRepository extends TrekRepository { await this.kysely() .insertInto('google_api_usage') .values({ day, calls: 1 }) - .onConflict((oc) => - // Qualified: Postgres reads a bare `calls` here as ambiguous between the - // target row and `excluded` (42702); SQLite accepts both spellings. - oc.column('day').doUpdateSet({ calls: (eb) => eb(eb.ref('google_api_usage.calls'), '+', 1) }), - ) + // The target row's column is qualified: Postgres reads a bare name as + // ambiguous between it and `excluded` (42702). + .onConflict((oc) => oc.column('day').doUpdateSet({ calls: (eb) => eb(eb.ref('google_api_usage.calls'), '+', 1) })) .execute(); } diff --git a/server/src/db/repositories/RouteUsageDaily.repository.ts b/server/src/db/repositories/RouteUsageDaily.repository.ts index 38cc7470d..4adaeea9a 100644 --- a/server/src/db/repositories/RouteUsageDaily.repository.ts +++ b/server/src/db/repositories/RouteUsageDaily.repository.ts @@ -80,9 +80,9 @@ export class RouteUsageDailyRepository extends TrekRepository { await this.kysely() .insertInto('route_usage_daily') .values(entry) + // The target row's columns are qualified: Postgres reads a bare name as + // ambiguous between it and `excluded` (42702). .onConflict((oc) => - // The target row's columns are qualified: Postgres reads a bare name - // as ambiguous between it and `excluded` (42702). oc.columns(['day', 'profile', 'surface', 'self_hosted']).doUpdateSet({ requests: (eb) => eb(eb.ref('route_usage_daily.requests'), '+', eb.ref('excluded.requests')), waypoints: (eb) => eb(eb.ref('route_usage_daily.waypoints'), '+', eb.ref('excluded.waypoints')),