Skip to main content

migration_checksum

Function migration_checksum 

Source
pub fn migration_checksum(
    version: i64,
    name: &str,
    ops: &[MigrationOp],
) -> String
Expand description

Compute a deterministic, content-aware SHA-256 checksum for a migration.

The checksum covers the version, name, and the ordered list of ops via a single canonical serialization ([canonical_content]) that is byte-for-byte identical to the TypeScript kit (packages/kit/src/migrate.ts). The same logical migration therefore produces the same checksum in every language, and changing any op changes the checksum.