Skip to main content

diff

Function diff 

Source
pub fn diff(
    from: &ProjectState,
    to: &ProjectState,
) -> Result<Vec<Operation>, MigrationError>
Expand description

Operations that turn from into to, in a deterministic order:

  1. Delete constraints, indexes, fields
  2. Delete models (reverse FK dependency order)
  3. Rename fields
  4. Create models (topological by FK dependencies; cyclic FKs are deferred as Operation::AddField)
  5. Add / alter fields
  6. Create indexes and constraints