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)