Skip to content

Feat/harden db migrations and transaction model - #427

Merged
chizzy192 merged 3 commits into
StellarState:devfrom
daniel506432-prog:feat/harden-db-migrations-and-transaction-model
Aug 30, 2026
Merged

Feat/harden db migrations and transaction model#427
chizzy192 merged 3 commits into
StellarState:devfrom
daniel506432-prog:feat/harden-db-migrations-and-transaction-model

Conversation

@daniel506432-prog

Copy link
Copy Markdown
Contributor

Summary

Refactor and harden the database migration and transaction model for improved
performance, resilience, and maintainability.

Changes

  • Hardened the initial schema migration: each DDL step is isolated, guarded
    by table-existence checks, logged, and wrapped with structured error
    context. Failures now surface as an AppError carrying the failing migration
    name while preserving the exact schema produced on a fresh install.
  • Optimized the Transaction entity by adding a composite user-history index for
    faster transaction-history fetching and synced it in the migration so the
    production schema matches the model.
  • Added unit tests for the migration and the Transaction entity covering
    creation, rollback, idempotent guards, error wrapping, and entity metadata.

Test Plan

  • Migration unit tests: PASS
  • Transaction model unit tests: PASS
  • Lint on changed files: clean
  • No new type errors introduced by these changes

Issues

closes #328

closes #329

closes #330

closes #331

…ging and error handling

Refactor the initial schema migration so every DDL step is isolated, guarded by
table-existence checks, logged, and wrapped with structured error context. A
failure now surfaces as an AppError carrying the failing migration name while
preserving the exact schema produced on a fresh install.

closes StellarState#328
closes StellarState#329
closes StellarState#331
…tory index

Add a (user_id, timestamp) composite index to the Transaction entity to serve
user transaction-history queries without a full scan, and mirror the same index
in the migration so the production schema matches the model.

closes StellarState#330
@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@daniel506432-prog Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@chizzy192
chizzy192 merged commit 43ff84e into StellarState:dev Aug 30, 2026
3 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment