Skip to main content

Module diff

Module diff 

Source
Expand description

Schema-diff types: compare two schema versions and produce structural changes. Schema-diff types.

Compares two db::Schema versions and produces structured changes consumed by drivers to generate migrations.

§Examples

use toasty_core::schema::{db, diff};

let previous = db::Schema::default();
let next = db::Schema::default();
let hints = diff::RenameHints::new();
let d = diff::Schema::from(&previous, &next, &hints);
assert!(d.is_empty());

Structs§

Columns
The set of differences between two column lists.
Context
Shared context passed to all diff computations.
Indices
The set of differences between two index lists.
RenameHints
Hints that tell the diff algorithm which schema items were renamed.
Schema
The top-level diff between two database schemas.
Tables
The set of differences between two table lists.
Types
The diff between named enum types across two schema versions.

Enums§

ColumnsItem
A single change detected between two column lists.
IndicesItem
A single change detected between two index lists.
TablesItem
A single change detected between two table lists.
TypesItem
A single change to a named enum type.