computeMigrationChecksum function
Computes the stable checksum stored with a migration artifact.
Implementation
String computeMigrationChecksum({
required String provider,
required String beforeSchema,
required String afterSchema,
required String migrationSql,
required List<String> warnings,
required bool requiresRebuild,
}) {
final payload = jsonEncode(<String, Object>{
'provider': provider,
'beforeSchema': beforeSchema,
'afterSchema': afterSchema,
'migrationSql': migrationSql,
'warnings': warnings,
'requiresRebuild': requiresRebuild,
});
return sha256.convert(utf8.encode(payload)).toString();
}