`besu check`
Not supported yet. There is no
checksubcommand. The CLI's own commands arepull,push,generateandmigrate.
Drizzle Kit's check compares the migrations folder against the schema and reports what is
inconsistent. Besu has no command that does that ahead of time. The equivalent checks happen
when the diff is computed or when the runner starts.
The schema equivalent
besu push --dry-run prints the plan without running it, which is the closest thing to a
check of one snapshot against one database:
The output schema is up to date means the snapshot matches. In code, the same diff is
available directly:
Pass the target dialect's normalise_type as the third argument, or use
db.push_schema(&desired) and inspect the result, to get the folding push would apply.
The migration equivalent
An edited migration is caught when the runner opens the journal, not by a separate command:
A checksum mismatch stops the run before any statement, with the recorded and current digest.
The runner also rejects two files with the same version, and Migrator::from_dir rejects a
.down.sql with no up file. Run besu migrate against a copy of the database to exercise
those checks without touching the real one.
Gotchas
- A dry run still connects.
--dry-runintrospects the live database, so it fails against an unreachable URL. - The diff is not a verdict. It reports what would change, not whether the change is
safe. A
Destructiveline in the output is the signal to stop. - There is no check of the migrations directory against the snapshot. Nothing compares the applied files with the schema your code declares.
