Skip to content

Add safe decimal migration tooling#397

Merged
kilodesodiq-arch merged 1 commit into
ChainForgee:mainfrom
kimanicode:feat/decimal-migration-tooling-238
Jul 21, 2026
Merged

Add safe decimal migration tooling#397
kilodesodiq-arch merged 1 commit into
ChainForgee:mainfrom
kimanicode:feat/decimal-migration-tooling-238

Conversation

@kimanicode

Copy link
Copy Markdown
Contributor

Summary

Closes #238.

Adds safe Float-to-Decimal migration tooling for money-like database columns. The script supports dry-run row counts, NaN/Infinity preflight rejection, gzipped JSONL backups, pg_dump --data-only safety backups, single-transaction conversion to NUMERIC, sentinel-based idempotency, and rollback restore from backup archives.

Also adds a database migration runbook and an npm script entry:

npm run decimal:migrate

## Testing 
npx tsc -p tsconfig.json --noEmit --pretty false
npx eslint scripts/decimal-migrate.ts
npx prettier --check scripts/decimal-migrate.ts ../../docs/db/decimal-migration.md package.json
npm run decimal:migrate -- --help

I did not run the migration against a live PostgreSQL database because no DATABASE_URL was provided.

Screenshots

Not applicable.

Checklist

  • Tests added or updated for new/changed behavior
  • Existing tests pass
  • No secrets, keys, or seed phrases committed
  • Follows the coding conventions in the relevant service README
  • PR is focused on a single concern

@kilodesodiq-arch kilodesodiq-arch left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kilodesodiq-arch
kilodesodiq-arch merged commit fe9ac71 into ChainForgee:main Jul 21, 2026
5 checks 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.

Tooling: safe migration of Float → Decimal with rollback

2 participants