Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

The reported result is six of six migrations passing in CI against a Neon branch of production, and one migration passing against production itself. Neon’s documentation describes the kind of branch-based testing that makes a run like this possible, but it does not verify this particular run and does not explain why the two counts differ. The gap could come from several parts of the setup, and nothing published by Neon identifies which one applies here.

What the reported numbers establish

The figures describe one run, reported by whoever ran it. No Neon source confirms them. Two details matter before any comparison is made. First, “Passed 1” is ambiguous: it can mean that one migration ran on production and passed, or that only one migration was eligible to run there. Those readings lead to very different conclusions. Second, a branch and production are two separate database states, so equal or unequal pass counts say little on their own about whether the same change behaves the same way in both places.

What Neon documents about branches in CI

Neon’s documentation describes branching as a way to build separate database environments for testing and CI/CD. The documented patterns include:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Creating a database branch for each pull request through a GitHub Action, so each change is tested against its own environment.
  • Creating a copy-on-write clone of a production database with a dedicated compute endpoint for testing, then removing that environment when testing is finished.

These are capabilities the vendor describes. They show what a branch-based setup can do. They do not show that a particular migration run was executed correctly or what it produced.

Every Neon project starts with a root branch named main, and a project can contain one or more branches. If the CI branch was created from main, its starting point is whatever main held when the branch was created, which may not match what production held when it was migrated.

Why a branch and production can disagree

The published material does not name the migration framework, the application, the CI provider, the point at which the branch was created, or the commands used. Without those, the following are the usual places where two migration runs diverge. They are things to check, not established causes.

Different starting schema or data

A branch is a snapshot of its parent at a point in time. If production changed after the branch was created, or the branch was created from a different parent than production, the migrations were tested against a different schema. A migration can pass on one starting state and fail on another, for example when it assumes a column or index that exists in only one of them.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Different migration history

Most migration tools record applied migrations in a history table in the database. If the branch’s history table differs from production’s, the tool may skip some migrations on one side and run them on the other. A count of six on the branch and one on production can be a symptom of this mismatch rather than a failure of the migrations themselves.

Different commands or configuration

A run can differ through its environment variables, its connection string, the migration tool version, or the flags passed to it. The most important check is whether the connection string used in CI points to the branch and the one used for production points to production, and whether each run used the same migration command.

Different timing or deployment sequence

Production may have received some migrations earlier, or in a different order, than the branch test. A branch that was created before a production deployment, or a deployment that was split into parts, can produce counts that look inconsistent even when every step worked.

How to find the cause

Work through these steps in order. Each one narrows the explanation before the next.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Write down the exact migration list on each side, by filename or ID. Confirm whether “Passed 1” means one migration was run or one was eligible.
  2. Compare the migration history table on the branch and on production, using the table your own migration tool maintains.
  3. Pin the starting point. Neon’s branch schema retrieval can return a branch’s schema at its head or at a specified log sequence number (LSN) or timestamp, in SQL or JSON. Neon’s schema comparison endpoint compares a database schema with another branch’s schema and accepts LSN or timestamp comparison points. Use these to check whether the branch and production had the same schema when the migrations ran.
  4. Diff the commands and configuration: tool version, command, environment variables, and the target database in each connection string.
  5. Check deployment records for production: which migrations were applied, when, and whether the branch was created before or after those changes.
  6. Only after these checks, decide whether the branch test was representative of production.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Side-by-side checklist for the two runs

Axis CI branch run Production run What to check
Starting schema Not stated in the reported result Not stated in the reported result Schema at the branch’s creation point versus production’s schema at deploy time, using Neon’s schema retrieval and comparison
Data state Not stated in the reported result Not stated in the reported result Whether the branch was seeded from production, a fixture set, or an empty state
Migration history Not stated in the reported result Not stated in the reported result Applied-migration records in each database
Command and configuration Not stated in the reported result Not stated in the reported result Tool version, command, flags, environment variables, and connection string target
Timing and sequence Not stated in the reported result Not stated in the reported result Branch creation time relative to production deployments

The reported result does not supply any of these values. Each row needs to be filled from the CI log and deployment records before the two counts can be compared.

What a passing branch does and does not prove

A branch where every migration passes is evidence that the migrations apply cleanly to that branch’s starting state. It is not evidence about production unless the branch matches production’s schema, data, history, and command set at the time the migrations run. Treat the branch result as a test of the change, and treat production’s record as the record of what actually changed. When they disagree, the disagreement is a reason to check the setup, not a reason to assume either side is wrong.

Neon’s branching makes it practical to test against a copy of production before a change goes live. Whether that test is representative depends on the points listed above, and the reported run does not yet show that they matched.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.