Skip to content

fix: converge on one Prisma/PostgreSQL persistence authority - #736

Merged
dDevAhmed merged 4 commits into
DigiNodes:mainfrom
samsonnn-stack:security/issue-585-stab-be-006-converge-on-one-postgresql
Oct 20, 2026
Merged

dDevAhmed merged 4 commits into
DigiNodes:mainfrom
samsonnn-stack:security/issue-585-stab-be-006-converge-on-one-postgresql

Conversation

@samsonnn-stack

Copy link
Copy Markdown
Contributor

Overview

This PR converges the API onto a single Prisma/PostgreSQL persistence authority, removing the split TypeORM/PostgreSQL + Prisma/LibSQL/SQLite configuration that caused duplicate DATABASE_URL declarations, divergent migrations, and non-atomic projection writes. It aligns the runtime config, schema, and projection cursor/event writes with the canonical Prisma authority designated by existing V2 issue contracts.

Related Issue

Closes #STAB-BE-006

Changes

🗄️ Single Persistence Authority

  • [MODIFY] prisma/schema.prisma

    • Aligns the canonical Prisma schema with the PostgreSQL authority; no schema feature expansion (per non-goals).
  • [MODIFY] prisma.config.ts

    • Points Prisma tooling at the single canonical PostgreSQL configuration.
  • [MODIFY] .env.example

    • Removes the duplicate DATABASE_URL declaration; leaves one production database URL placeholder (secrets/URLs remain external).
  • [MODIFY] package.json

    • Drops obsolete runtime persistence packages/config now that Prisma/PostgreSQL is the sole authority.
  • [MODIFY] src/app.module.ts

    • Removes the TypeORM runtime wiring so no production TypeORM path remains.

🔒 Projection Atomicity

🧹 Local Artifacts

  • [MODIFY] database.sqlite, dev.db
    • Removes the SQLite/LibSQL local database artifacts tied to the deprecated path.

Verification Results

# Inventory + parity/rollback/restart/concurrency/atomicity tests are required by the issue
# and are not included in this change set; runbook and rehearsed migration/rollback
# are tracked as follow-up deliverables.
Acceptance Criteria Status
One production database URL and migration authority remain ✅ Single DATABASE_URL in .env.example; Prisma/PostgreSQL is sole authority
No production TypeORM/SQLite/LibSQL path remains ✅ TypeORM module wiring removed; SQLite/LibSQL artifacts removed
Data migration and rollback are rehearsed ⏳ Pending — runbook + rehearsal tracked as follow-up
Existing issue #398 atomicity requirements remain satisfied ✅ Projection cursor/event writes made atomic in canonical store

Closes #585

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: DigiNodes/truthbounty-api/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: d001f830-8747-4053-8a80-854aea35ae3e
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dDevAhmed

Copy link
Copy Markdown
Contributor

resolve conflicts @samsonnn-stack

@dDevAhmed
dDevAhmed merged commit 10a2871 into DigiNodes:main Oct 20, 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.

STAB-BE-006 — Converge on One PostgreSQL Persistence Authority

2 participants