LAFU Sales Reports

CRITICAL: deploy runs migrations with no dry-run, no pre-flight check, no halt-on-failure

BugShipped· 28 days ago

Imported from GitHub issue El-SaMa/oma#108 by @El-SaMa.


Severity: Critical for a live solo-operator system.

`migrate.mjs` supports `--dry-run`, `--baseline`, and `--to=` flags — none are ever invoked. `scripts/docker-stack-up.sh` line 37-38 runs migrations blind, and line 41 starts containers regardless of whether the migration step succeeded. A broken migration leaves the stack running against a half-migrated schema with no automatic halt.

CI also never dry-runs migrations against a throwaway DB, so a broken migration is only ever discovered live, during deploy, in production.

Fix:

  1. Add a CI step: `docker compose run --rm migrate node migrate.mjs --dry-run` against a throwaway Postgres, on every PR.
  2. Make `docker-stack-up.sh` halt (non-zero exit, don't proceed to `docker compose up -d`) if the migrate step fails.

Comments (0)

No comments yet.

Join the discussion

Sign in to leave a comment on this thread.

HollahoopGet yours