A migration tested against an empty schema, run against nine hundred million rows, and taking four hours instead of four seconds.
# the job, weekly, against a restored copy
./bin/restore-drill --into=migration-test
docker compose exec -T migration-test
php artisan migrate --pretend > /tmp/sql
for stmt in $(./bin/split-statements /tmp/sql); do
./bin/time-statement migration-test "$stmt"
done
# any statement over 30 seconds fails the check.
The restore drill already produced a full copy of production every month, and reusing it to time the pending migrations was an afternoon of work for a check that has fired three times. A migration that takes four hours on real data and four seconds on an empty schema is not a rare case — it is every index on a large table.