glimr/db/gen/migrate
Migration Generator
Writing migration SQL by hand after every schema change is tedious and error-prone — developers forget columns, get types wrong, or miss renames. This module compares the current schema files against a stored snapshot to detect changes automatically and emit driver-specific SQL. The snapshot is updated after each run so only new changes appear in subsequent migrations.
Values
pub fn run(
name: String,
model_filter: option.Option(List(String)),
verbose: Bool,
) -> Nil
Pass a connection name and the migration system figures out the rest — reads the driver type from database.toml, finds the schema files, diffs against the snapshot, and writes the migration SQL. The optional model filter lets you generate migrations for just the tables you changed.