diff --git a/src/modules/metadata/Metadata.types.ts b/src/modules/metadata/Metadata.types.ts index 22cfc39a..9aeae896 100644 --- a/src/modules/metadata/Metadata.types.ts +++ b/src/modules/metadata/Metadata.types.ts @@ -20,7 +20,7 @@ export interface IMetadataMigration { * Otherwise, all metadata keys will get migrated. */ key?: string; - oldValue: string; + oldValue: string | RegExp; newValue: string; }[]; keys?: { oldKey: string; newKey: string }[]; diff --git a/src/modules/metadata/services/MetadataMigrations.ts b/src/modules/metadata/services/MetadataMigrations.ts index 0159e0f3..fbfec4cf 100644 --- a/src/modules/metadata/services/MetadataMigrations.ts +++ b/src/modules/metadata/services/MetadataMigrations.ts @@ -59,7 +59,7 @@ const applyMetadataValueMigration = (meta: Metadata, migration: IMetadataMigrati metadataValueChanges.forEach(({ key, oldValue, newValue }) => { const migrateValue = (metaKey: string) => { - if (meta[metaKey] === oldValue) { + if (meta[metaKey].match(oldValue)) { migratedMetadata[metaKey] = newValue; } };