DATA OPS

PR-time schema guard: apply migration to a shadow DB and post a GitHub check

On every pull request touching migration files, spins up a shadow copy of production schema, applies the PR's migrations, diffs the result against staging.

CategoryData Ops
Enginesim
Difficultyadvanced
Triggerevent
Steps5
Setup~25 min

How it runs

The automated pipeline, trigger to output.

  • TriggerPR opened touching migrationsGitHubGitHub
  • ActionProvision shadow DB from prod schemaPostgreSQLPostgres
  • ActionApply PR migrations to shadow DBPostgreSQLPostgres
  • LogicDiff shadow schema vs staging; decide pass/fail
  • OutputPost GitHub check run with schema deltaGitHubGitHub

What it does

When a pull request changes anything under your migrations directory, this workflow replays those migrations against a throwaway shadow database seeded from the current production schema, then diffs the post-migration schema against staging. It posts the computed schema delta as a GitHub check run so reviewers see exactly what the PR will do to the live catalog.

When to use it

Use it to make migration review concrete. Instead of reading SQL and imagining the outcome, reviewers get the actual before/after table, column, and index changes, plus a hard fail if the migration produces drift staging hasn't already validated.

How it works

  1. 1A GitHub pull-request event with migration-path changes triggers the run.
  2. 2Provision a shadow Postgres from the production schema snapshot.
  3. 3Apply the PR's migration files in order to the shadow DB.
  4. 4Diff the shadow schema against staging's current schema.
  5. 5Branch: if the delta is empty or matches expectations, mark success; otherwise mark failure.
  6. 6Post a GitHub check run with the rendered schema delta and status.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect GitHubRepos, issues, pull requests, actions.
  2. 2
    Connect PostgresAny Postgres URL — query, write, migrate.
  3. 3
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  4. 4
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  5. 5
    Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.

Run this workflow in your colony.

14-day trial. No DevOps. No Sales call. Provisioned in under a minute.