Skip to content
Latchkey

sqitch verify: Check Deployed Changes

sqitch verify runs the verify script for every deployed change to confirm the schema is actually in the expected state.

verify is Sqitch built-in assertion pass. Each change ships a verify script that queries for the objects it should have created.

What it does

sqitch verify iterates the deployed changes and runs each verify/*.sql script against the target. A verify script typically SELECTs from the object the change created, so a missing table or column makes it fail, flagging drift.

Common usage

Terminal
sqitch verify db:pg://ci:$DB_PASSWORD@db:5432/app

# verify a specific named target from sqitch.conf
sqitch verify production

Options

Flag / argWhat it does
<target>Target URI or named target to verify
--from-change / --to-changeVerify a range of changes
--variable <k=v>Pass a value into the verify scripts

In CI

Run sqitch verify after deploy (or use sqitch deploy --verify) as a post-migration gate that fails the pipeline if the schema does not match the plan. It is read-only when the verify scripts are pure SELECTs, so it is safe to run against any target you can reach.

Common errors in CI

"Verify failed" lists each change whose verify script errored, usually because an expected object is missing. "Cannot find plan file" means running outside the project directory. A verify that fails right after a successful deploy points at a verify script that does not match what the deploy script actually creates.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →