Compare and generate
The baseline DB selector only includes connections where every migration is applied. Sonamu compares that databaseβs schema with the Entity definitions and previews the changes and generated code.- Select a baseline database.
- Use Expand all to review the generated code when needed.
- Select Generate migrations to create the files.
Migration status
Rows are migration files and columns are database connections. Each cell showsAPPLIED or PENDING. Connections load independently, so a slow or failed database does not block other columns.
- Select an execution target by clicking its column header or cells.
- Enable Details to show the host, database, remote marker, and per-column refresh action.
- Select an Error badge to inspect the server error.
Apply latest
Apply latest runsknex.migrate.latest() for each selected database in order. Files applied to one database remain in one Knex batch.
The execution dialog has these stages:
- Review the targets and Pending files, and choose whether to run Shadow validation.
- Approval requests Slack approval for configured remote targets and checks it every two seconds.
- Apply displays per-file progress and per-database completion.
Rollback
Rollback ignores migration-file row selection and rolls back the entire latest Knex batch on each selected database. Knex runs the batchβsdown() functions in reverse order.
Because this is destructive, the first click only arms the Rollback button and changes its confirmation text. The second click starts the operation. If a file fails, execution stops at that file. The rollback transaction is canceled, so the database may appear unchanged. Rollbacks run from the latest migration backward, so execution cannot continue to the next rollback after a failure in the middle.
Next steps
Scaffolding Tab
Generate Model code
migrate CLI
Manage migrations from the CLI