Add logic to migrate metadata values (#227)

Makes it possible to rename or fix values of already saved metadata without the user losing his data
This commit is contained in:
Daniel
2023-02-17 13:10:44 +01:00
committed by GitHub
parent 5473d14eae
commit cd1d24ada7
2 changed files with 119 additions and 1 deletions

9
src/typings.d.ts vendored
View File

@@ -56,6 +56,15 @@ interface IState {
interface IMetadataMigration {
appKeyPrefix?: { oldPrefix: string; newPrefix: string };
values?: {
/**
* In case the migration should only be applied to a specific metadata key.
* Otherwise, all metadata keys will get migrated.
*/
key?: string;
oldValue: string;
newValue: string;
}[];
keys?: { oldKey: string; newKey: string }[];
}