Skip to content

Nothing applies a migration, so a schema change is an outage #277

Closed

Description

@Miracle656

Background

This repo commits its migrations — there are nine under prisma/migrations/ —
and nothing runs them. build is tsc, start is node dist/index.js.

So a PR that adds a column and its migration still leaves the column missing in
production until somebody runs it by hand. On the offramp that is worse than a
plain failure: createOfframpOrder calls Linq before writing our row, so a
failed insert leaves a real provider payout order with no record of ours.

This nearly happened: PR #210 added requestHash with no migration at all.

What to build

  • Apply migrations as part of starting or deploying, or fail loudly when the
    database is behind what the code expects. Either is defensible; silently
    running against an older schema is not.
  • Be careful with prisma migrate deploy here: past use of prisma db push
    means _prisma_migrations may not record migrations that are in fact
    applied, so a naive deploy may try to recreate existing objects. Investigate
    the real state before choosing, and write down what you found.

Acceptance criteria

  • A schema newer than the database is detected, not ignored
  • The chosen mechanism is documented, including why
  • The _prisma_migrations state is checked and the finding recorded
  • Nothing drops or rewrites an existing table

Drips Wave · Complexity: Intermediate · 150 points


Repo: Miracle656/wraith (Express + TypeScript + Prisma). Run npm test
(jest) and npm run typecheck. Both must pass.

This service moves real money, and Linq has no sandbox. Every /ngn and
/offramp route is mainnet-gated at the router for that reason. Test against
the fake provider in src/__tests__, never against Linq. A single careless
integration test spends somebody's naira.

The provider rate limit is shared and real. All Veil users share one Linq
key. Four manual probes of /ngn/onramp/rate returned 429 rate_limited
during a review. Do not poll the live provider while developing.

A NIN is personal data under Nigeria's NDPA. It must never be stored,
logged, or placed in a test fixture. The existing KYC fixtures contain error
codes and messages only — keep it that way.

Metrics labels must be bounded. Label by things drawn from a finite set:
rail, route, outcome, network, provider error code. Never by an order id, a
customer reference, an amount, a URL or a raw provider message. An unbounded
label makes /metrics grow until it cannot be scraped.

A schema change needs a migration. This repo commits migrations under
prisma/migrations/, and neither build nor start applies one. A
schema.prisma change merged without a migration file means the column never
exists in production. After changing the schema run npx prisma generate
before typecheck, or you will chase errors that are not real.

Never elide an address, a contract id or a key in code, comments or test
fixtures. A previous batch shortened a contract id in an issue text and five
contributors invented their own to fill the gap.



Required: Before submitting, join the contributor Telegram so your work can be tracked and counted toward the Stellar Wave: https://t.me/+fxHXq8f1SwlkZDBk

Activity

  1. Maxl500 commented on Oct 21, 2026

    @Maxl500

    @Maxl500 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    I’d be glad to take this task forward and ensure the changes remain consistent with the codebase.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Maxl500 to this issue.

  2. Fabluchy commented on Oct 21, 2026

    @Fabluchy
    Contributor

    @Fabluchy has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    I'll like to work on this issue please

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Fabluchy to this issue.

  3. waledev1 commented on Oct 21, 2026

    @waledev1

    @waledev1 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Hi Maintainer, I can help resolve this issue

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @waledev1 to this issue.

  4. drips-wave commented on Oct 21, 2026

    @drips-wave

    Congratulations, @Fabluchy! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on October 22, 2026.

    🧑‍💻 @Fabluchy: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  5. added a commit that references this issue on Oct 22, 2026
  6. drips-wave commented on Oct 22, 2026

    @drips-wave

    This issue has been completed by @Fabluchy as part of the Stellar Wave Program's 10th Wave 🥳

    😎 @Fabluchy: You earned 150 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions