pub fn schema_diff(
current: &DatabaseSchema,
expected: &DatabaseSchema,
) -> SchemaDiffExpand description
Compare two schemas and generate operations to transform current to expected.
§Example
ⓘ
use sqlmodel_schema::{expected_schema, Dialect};
use sqlmodel_schema::diff::schema_diff;
let current = introspector.introspect_all(&cx, &conn).await?;
let expected = expected_schema::<(Hero, Team)>(Dialect::Sqlite);
let diff = schema_diff(¤t, &expected);
for op in &diff.operations {
println!(" {:?}", op);
}