Skip to content

[Backend] add-loan-events-missing-indexes has an empty down(), leaking four indexes on rollback #1193

Description

@grantfox-oss

Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0

Why this matters

migrations/1788000000018_add-loan-events-missing-indexes.js:43 defines down = () => {} (no-op), so rolling this migration back leaves idx_loan_events_borrower, idx_loan_events_event_type, idx_loan_events_loan_id_event_type and idx_loan_events_created_at behind. A re-apply or a later differently-defined index of the same name then collides, and the migration is not truly reversible.

Acceptance criteria

  • Implement down() to DROP INDEX IF EXISTS each of the four indexes created in up()
  • Confirm migrate:down then migrate:up round-trips cleanly

Files to touch

  • backend/migrations/1788000000018_add-loan-events-missing-indexes.js

Out of scope

  • Colliding migration timestamp prefixes (already filed)

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programbackendIssues related to backend developmentbugSomething isn't workingdatabaseDatabase related issuesgood first issueGood for newcomers

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions