diff options
Diffstat (limited to 'lib/config/migrations.go')
-rw-r--r-- | lib/config/migrations.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/config/migrations.go b/lib/config/migrations.go index 10976c3353..51512d924d 100644 --- a/lib/config/migrations.go +++ b/lib/config/migrations.go @@ -27,6 +27,7 @@ import ( // put the newest on top for readability. var ( migrations = migrationSet{ + {35, migrateToConfigV35}, {34, migrateToConfigV34}, {33, migrateToConfigV33}, {32, migrateToConfigV32}, @@ -93,6 +94,24 @@ func (m migration) apply(cfg *Configuration) { cfg.Version = m.targetVersion } +func migrateToConfigV35(cfg *Configuration) { + for i, fcfg := range cfg.Folders { + params := fcfg.Versioning.Params + if params["fsType"] != "" { + var fsType fs.FilesystemType + _ = fsType.UnmarshalText([]byte(params["fsType"])) + cfg.Folders[i].Versioning.FSType = fsType + } + if params["versionsPath"] != "" && params["fsPath"] == "" { + params["fsPath"] = params["versionsPath"] + } + cfg.Folders[i].Versioning.FSPath = params["fsPath"] + delete(cfg.Folders[i].Versioning.Params, "fsType") + delete(cfg.Folders[i].Versioning.Params, "fsPath") + delete(cfg.Folders[i].Versioning.Params, "versionsPath") + } +} + func migrateToConfigV34(cfg *Configuration) { cfg.Defaults.Folder.Path = cfg.Options.DeprecatedDefaultFolderPath cfg.Options.DeprecatedDefaultFolderPath = "" |