Skip to content

Make schema constraints and migration safety resilient in src/db/schema.ts #361

Description

@Jagadeeshftw

Description

The current path can fail in ways that are hard to retry or safely replay. src/db/schema.ts owns schema constraints and migration safety, but the current behavior does not yet define the contract tightly enough for safe maintenance. Design the change so the runtime path, tests, and docs all describe the same behavior.

Requirements and context

  • Keep the contract specific to src/db/schema.ts and its existing callers.
  • Add coverage for the success path and the failure or boundary path relevant to this issue.
  • Preserve compatibility where older callers or existing tests already rely on the current shape.
  • Keep the change easy to review and small enough for one focused PR.

Suggested execution

Fork the repo and create a branch

git checkout -b schema-safety-reliability-175

Implement changes

  • Update/Write: src/db/schema.ts
  • Write comprehensive tests: src/db/migration.test.ts
  • Add documentation: docs/db/schema.md
  • Keep any new helper names consistent with the rest of src/

Test and commit

  • Run pnpm test
  • Run pnpm lint
  • Add a note for any edge cases that are intentionally out of scope

Example commit message

fix: improve reliability and retry semantics

Guidelines

  • WCAG 2.1 AA is not relevant here; keep the focus on correctness and maintainability.
  • Prefer a narrow, well-documented fix over a broad refactor.
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSGrantFox open-source programMaybe RewardedGrantFox: potentially rewarded contributionOfficial Campaign | FWC26GrantFox official campaign issueStellar WaveIssues in the Stellar wave programapibackendBackend / API workdatabaseDatabase / schema / indexing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions