migrationFingerprint function
Calculates the fingerprint to paste into a reviewed Dart migration file.
This does not load or save any files. Collection order and SQL whitespace are significant, so source changes cannot silently preserve the reviewed hash.
Implementation
String migrationFingerprint({
required int version,
required String name,
required Engine engine,
required List<String> steps,
required SchemaSnapshot snapshot,
}) => sha256
.convert(
utf8.encode(
jsonEncode([
'orm-migration-v1',
version,
name,
engine.name,
steps,
snapshotValue(snapshot),
]),
),
)
.toString();