Status
migrate status diffs the on-disk migrations against _mount_migrations and
reports what has run and what is pending.
Syntax
Section titled “Syntax”mountsqli migrate statusExample output
Section titled “Example output”$ mountsqli migrate statusApplied: 2026-07-10T09-00-00_init.sqlPending: 2026-07-16T12-00-00_add_posts.sqlHow pending is computed
Section titled “How pending is computed”status needs the known set — the migrations on disk — to compute pending.
Call status(knownSteps) with those steps; with no argument pending is empty
(issue 004). The CLI always supplies the known steps.
import { Migrator } from "@mountsqli/migration";
const migrator = new Migrator(driver, migrationsDir);const { applied, pending } = await migrator.status(knownSteps);// applied: string[] of migration names// pending: MigrationStep[] not yet runDrift detection
Section titled “Drift detection”If a migration was applied but its file is gone, status flags the mismatch.
The Studio and mountsqli analyze surface the same drift.
Best practices
Section titled “Best practices”- Run
statusin CI to fail the build on unapplied migrations. - Treat
pendingas a to-do list before deploy.
Common mistakes
Section titled “Common mistakes”- Calling
status()with no args and expectingpendingto be populated. - Deleting an applied file — status then reports drift.
Related
Section titled “Related”- Apply — run the pending ones.
- How Migrations Work — the
_mount_migrationstable.
