thefoldwithin-earth/migrations/v2_2/transform.js

11 lines
326 B
JavaScript
Raw Normal View History

2025-10-19 16:48:12 -05:00
// Migration from v2.2 to v2.3: Add migration_hash if missing
import crypto from 'crypto';
export default function transform(meta, content) {
if (!meta.migration_hash) {
const hash = crypto.createHash('sha256').update(JSON.stringify(meta) + content).digest('hex');
meta.migration_hash = hash;
}
return meta;
};