From ea885fc405568f6ecacbf689fc3b367bd00626c7 Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Sun, 17 Aug 2025 21:32:44 -0700 Subject: [PATCH] Added migration --- src/datastore/DataStore.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/datastore/DataStore.ts b/src/datastore/DataStore.ts index 96efef8..5a5487b 100644 --- a/src/datastore/DataStore.ts +++ b/src/datastore/DataStore.ts @@ -3,6 +3,7 @@ */ import Configstore = require('configstore') import fs = require('fs-extra') +import { IAppDefSaved } from '../models/AppDefinition' import { AutomatedCleanupConfigsCleaner, IAutomatedCleanupConfigs, @@ -77,6 +78,20 @@ class DataStore { } ) + // running migrations + if (data.get('schemaVersion') < 2) { + const appDefinitions = data.get('appDefinitions') + if (appDefinitions) { + Object.keys(appDefinitions).forEach((appName) => { + const appDef = appDefinitions[appName] as IAppDefSaved + appDef.isLegacyAppName = true + }) + } + + data.set('appDefinitions', appDefinitions) + data.set('schemaVersion', 2) + } + this.data = data this.namespace = namespace this.data.set(NAMESPACE, namespace)