Key takeaways
- A schema change on Apps runs no migration. Production reads its stored records through the new schema files the moment they go live, so the question is what those records will read like, not whether a migration will run.
- The deploy plan answers it before you click Deploy: each field added, removed, renamed, retyped, required or unique, and how many of production's records as stored now each one reaches.
- Five kinds reach stored data: a removed field or model still holding values, a new type that can't convert some values, and a required or unique rule that existing records already break. The plan counts them.
- The same plan runs as a GitHub check on pull requests into a followed branch, and fails the check on those five kinds unless Settings → Git says to warn instead.
Most deploy tools answer one question: did the build pass? For an app with a database, the question that matters is different. What happens to the data that's already there?
On Apps that question has an unusual shape, because a schema change runs no migration. Production reads its records through production's schema files, so a change takes effect the moment the new files go live. No DDL runs and no record is rewritten. A new field reads its default. A removed field is hidden, its values kept. A renamed field keeps its storage key, so its values follow. A retyped field converts as it is read. A field that becomes required or unique applies to the next write of each record.
That removes a whole class of deploy-time failure. There's no migration to time out halfway, no lock on a table during a sale, and a rollback reads the records the way the old code did. But it moves the risk somewhere quieter. A migration that fails tells you. A schema that silently reads a thousand records as null doesn't.
The deploy plan exists to make that noise before the deploy.
What the plan shows
Deploy in development's top bar opens it. Nothing changes until you choose Deploy on the plan itself. It has five parts.
What will happen is the steps in order, each marked Automatic or You: creating production's Shopify app if it's missing, copying files, reading records with the new schemas, building, and installing on the merchant's store if it isn't yet. The You steps are the ones the plan can't do for you, and on a first deploy there are usually two.
Model changes is the part this article is about. Each change is one row: the model, the field, the kind of change, and what production's records will read like with how many of them it reaches, counted from the records as they're stored now.
Review readiness appears for public Shopify apps: what Shopify's app review checks, read from the app as it stands. It never blocks a deploy.
Problems in development lists schemas that can't be read, a dev server that didn't start, and Shopify scopes that need protected-data approval.
Changes counts the files added, changed and deleted since the last deploy. A deploy with nothing changed is allowed; it rebuilds the same files, which is one way production picks up a changed environment variable.
The eight kinds of change
The plan tells apart eight kinds of schema change, and says something different about each.
| Change | What production's records do |
|---|---|
| Model added | Starts empty. |
| Model removed | Hidden. Its records are kept, so adding it back or rolling back restores them. |
| Field added | Reads its default, or null. Filters treat records as holding it. |
| Field removed | Hidden on the records that hold a value, kept for a rollback. |
| Field renamed | Its values follow, because the storage key didn't change. |
| Field retyped | Values convert when read. Any that can't read as null, and are stored in the new type on their next write. |
| Field now required | New records and writes to it must fill it. Existing empty values stay until written. |
| Field now unique | New values must be unique. Existing duplicates stay until written. |
Three of those are free. Adding a field or a model, and renaming a field, reach no stored value, so the plan lists them with no count. The other five can reach stored data, and the plan goes and looks.
Reaching production's records
For a removed field, the plan counts the records that still hold a value. They aren't deleted, but from the deploy on, the app can't read them, so the count is what the app stops seeing.
For a removed model, it counts the model's records, which go hidden together.
For a retype, it reads production's values in the field and counts the ones the new type can't convert. "12" becomes 12 for a number, and "twelve" becomes null. A count of zero means every stored value converts, and the retype is safe. A count above zero names the records that will read null until something writes them again.
For a new required rule with no default, it counts the records with no value in the field. Those records aren't rejected on read, but the next write to each one must fill the field, and an action that doesn't know about the rule will fail on the first record it touches.
For a new unique rule, it counts the records that share a value, and how many values are shared. Two records with the same email under a new unique rule stay as they are, until a write to either is refused.
Each count is exact where the plan can read every record, and at least where it stopped early on a large model. Either way, the plan's warnings at the top name every change that reaches a record, and none of them blocks the deploy. The plan's job is to make the choice an informed one, not to make it for you.
What to do with a count above zero
A count is a to-do list, and the plan links to it. Above a model's records in Files, a Stored data line appears whenever what's stored doesn't match the schema: values in an earlier type, values that can't convert, removed fields' hidden values, required fields left empty, and values shared under a unique rule. Review opens a row for each, with what can be done about it.
So the order that works is:
- Make the schema change in development and deploy its plan to read, not to run.
- For each count above zero, decide: fill the values first (an action that backfills the field, run from the Playground or the CLI), change the schema so the rule has a default, or accept that those records read null or empty until the app writes them.
- Deploy once the plan's counts say what you expect.
The thing to avoid is the one the plan was built to catch: a field made required in a schema, an action that assumes every record has it, and a Monday morning spent finding out which ones don't.
The same plan on every pull request
If an environment follows a GitHub branch, the plan doesn't wait for someone to open the deploy page. A pull request into that branch gets a check on its head commit, Deploy plan · <app>, saying what deploying that commit would do to production as it runs now. It runs again on each push.
The check's summary names each change that reaches production's records, with its count. Its details hold the full table of model changes and the deploy steps. Its conclusion follows a rule you set under Pull requests on Settings → Git:
- With fails on records, a change that reaches stored data, or a schema that can't be read, fails the check. The pull request shows it before the merge, where a reviewer can ask for the backfill.
- With it set to warn, the same cases make the check neutral. It still says everything it would have said.
- Nothing reaching stored data, and a readable schema, is Safe to deploy.
Type errors are deliberately not in it. A preview's Problems panel shows them as you work, and the production build type-checks pages, so a type error fails the build rather than the plan. The check is about data.
One pull request's check reads like this when it has something to say:
2 changes reach production's records
Deploying a3f9c21 compared with production as it runs now.
- order.total retyped: 38 records can't convert and will read null.
- customer.email unique: 12 records share 5 values.
And like this when it doesn't:
Safe to deploy
Deploying 7b02e4d compared with production as it runs now.
Why the plan doesn't block
A deploy tool that refuses to ship until the data is clean sounds safer than one that warns. It isn't, in practice. The team that needs to ship the fix for the bug that corrupted the values can't wait for the values to be clean. The team migrating a field over three deploys needs the middle deploy to go out with a count above zero on purpose.
So the plan counts, names, and links. The pull request check can fail, because a failed check is a conversation, not a wall: the reviewer who sees it can still merge. And production's schema files are a version like any other, so if the count turns out to matter more than it looked, Roll back to this on Settings → Deploys puts the previous files and build back together, and the records read as they did before.
What a deploy should tell you before a schema change is not yes or no. It's these records, this many, and this is what they'll read like. The rest is your call.
Frequently asked questions
Does a schema change run a migration on production?
No. Production reads its records through its schema files, so the change takes effect when the new files go live. No DDL runs and no record is rewritten. The plan says what the stored records will read like under the new schema.
Does the deploy plan ever block a deploy?
No. Every change reaching production's records is listed with its count as a warning, and Deploy stays available. The pull request check can fail, by the Settings → Git setting, so the change is seen before the merge.
What if a retype can't convert some values?
Those records read null in the field until they're written again, and the plan counts them before the deploy. Files' Stored data line lists each one afterwards, with what can be done.
Are type errors part of the deploy-plan check?
No. The preview's Problems panel shows type errors while you work, and the production build type-checks pages. The check is about what the deploy does to data.
Can I undo a schema change after deploying it?
Roll back to this on Settings → Deploys points production at an earlier deploy's build and brings its files back, schemas included, so the records read as they did before. Records themselves are not changed by a schema deploy.