Skip to content

Add automated database migration dry-run step to CI pipeline #840

Description

@RUKAYAT-CODER

Overview

The CI pipeline (.github/workflows/ci.yml) runs tests but does not validate TypeORM migrations against a real database. A broken migration is only discovered during deployment, potentially requiring a rollback under pressure.

Specifications

Features:

  • Run typeorm migration:run against a PostgreSQL service container in CI.
  • Fail the pipeline if the migration produces errors.

Tasks:

  • Add a PostgreSQL service to the CI workflow.
  • Add a CI step: npm run migration:run && npm run migration:revert (run then revert to verify both directions).
  • Add migration:generate check: fail if running it would produce a new migration (schema drift).
  • Update CONTRIBUTING.md with migration testing instructions.

Impacted Files:

  • .github/workflows/ci.yml
  • package.json (add migration scripts if missing)

Acceptance Criteria

  • CI fails if any migration file produces an error.
  • CI fails if model changes exist without a corresponding migration.
  • Revert step confirms migrations are reversible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programenhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions