mirror of
https://github.com/caprover/caprover
synced 2026-05-04 02:30:30 +00:00
Added migration
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user