Skip to content

fix(db): add compat view for renamed asset table + fix rootstockBalance casing#193

Merged
TaprootFreak merged 1 commit into
developfrom
fix/stale-schema-compat
May 26, 2026
Merged

fix(db): add compat view for renamed asset table + fix rootstockBalance casing#193
TaprootFreak merged 1 commit into
developfrom
fix/stale-schema-compat

Conversation

@davidleomay
Copy link
Copy Markdown
Collaborator

Summary

Adds a TypeORM migration to fix two stale-schema issues that cause ~6 Postgres errors/min on PRD:

  1. CREATE VIEW asset AS SELECT * FROM asset_account — the asset table was renamed to asset_account in migration 1715583133193-setupFrankencoinPay, but an external sync client still queries SELECT * FROM "asset".

  2. RENAME COLUMN "rootstockBalance" TO rootstockbalance — the column exists but the external client sends it unquoted, which Postgres case-folds to lowercase. The column is unused by the app (Rootstock integration removed in PR Remove Rootstock integration and add generic EVM balance monitoring #124).

Fixes #192

Test plan

  • Deploy to DEV, verify migration runs without error
  • Check lds-api-postgres-1 logs on PRD after deploy — errors should drop to 0

…ce casing

An external sync client polls POST /v1/support/db with hardcoded
table/column names that are out of date, causing ~6 PG errors/min:

1. `SELECT * FROM "asset"` — table was renamed to asset_account in
   migration 1715583133193. Create a view alias so old queries work.

2. `monitoring_balance.rootstockBalance` sent unquoted — Postgres
   case-folds to lowercase, doesn't match the mixed-case column.
   Column is unused by the app (Rootstock removed in PR #124).
   Rename to lowercase for compat.

Fixes #192
@TaprootFreak TaprootFreak merged commit e0bd4d9 into develop May 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

POST /v1/support/db: PRD caller polls stale schema (asset, monitoring_balance.rootstockBalance) → 6 PG errors/min

2 participants