Skip to main content

diff_model

Function diff_model 

Source
pub fn diff_model(
    migrations_dir: &Path,
    table: &str,
    model: &ModelSpec,
) -> 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 has no CREATE TABLE migration yet — there is nothing to diff against, and the caller should scaffold the resource (make crud / sync) first.