Skip to main content

diff_model

Function diff_model 

Source
pub fn diff_model(
    migrations_dir: &Path,
    table: &str,
    model: &ModelSpec,
    dialect: Dialect,
) -> Result<Option<SchemaDiff>>
Expand description

Compute the diff for model (a module’s declared shape) against the columns already present in its table’s generated migrations under migrations_dir.

Returns Ok(None) when the table does not exist after replay — there is nothing to diff against, and the caller should scaffold the resource (make crud / sync) first.