Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

How a missing DEFAULT column locked my production DB for 20 minutes (and why your CI won't catch it)

Описание и применение

Добавление NOT NULL без DEFAULT в большую таблицу PostgreSQL вызвало 20‑минутный сбой из‑за блокировки. migra‑guard, контекстно‑осознанный линтер, автоматически блокирует такие миграции в CI, предотвращая будущие простои.

Задача

Adding a NOT NULL column without a DEFAULT to a large production table caused a 20‑minute outage due to an Access Exclusive lock, and existing CI checks failed to catch the issue.

Результат

The migration pipeline now automatically blocks dangerous schema changes, eliminating the risk of production downtime caused by missing DEFAULT values on NOT NULL columns.

Рабочий процесс

  • 1. Add migra‑guard to the GitHub Actions CI workflow.
  • 2. Commit migration scripts to a PR.
  • 3. migra‑guard parses all migration files in the PR using an AST engine.
  • 4. It tracks the chronological state of tables across the PR.
  • 5. If a NOT NULL is added to an existing table without a DEFAULT, or an existing production table is dropped, the CI fails and the PR is blocked.
  • 6. Safe changes (new tables, temporary tables, NOT NULL on new tables) pass silently.

Доказательства

I decided we needed an automated check in our CI/CD pipeline to catch this.

Источник

migra‑guard uses an AST engine and tracks the chronological state of your migrations across your Pull Request.

Источник

  • Дата записи: 2026-09-05T18:45:37.554Z