Prevent applying already applied metadata migrations again

The "appliedMigrationId" was converted to it's index of the "METADATA_MIGRATIONS" and then was compared to the "migration id" which starts at 1 instead of 0
This commit is contained in:
schroda
2025-01-06 01:44:33 +01:00
parent 724319b6c5
commit 9f42b75eee

View File

@@ -308,7 +308,7 @@ export const applyMetadataMigrations = (
const migrationIdKey = getMetadataKey('migration');
const appliedMigrationId = Number.isNaN(Number(meta[migrationIdKey]))
? 0
: Math.max(0, Number(meta[migrationIdKey]) - 1);
: Math.max(0, Number(meta[migrationIdKey]));
const migrationToMetadata: [number, Metadata][] = [[0, meta]];