AdGuardHome/internal/configmigrate/v4.go

31 lines
542 B
Go
Raw Permalink Normal View History

2024-01-30 18:43:51 +03:00
package configmigrate
2023-09-07 17:13:48 +03:00
// migrateTo4 performs the following changes:
//
// # BEFORE:
// 'schema_version': 3
// 'clients':
// - # …
// # …
//
// # AFTER:
// 'schema_version': 4
// 'clients':
// - 'use_global_blocked_services': true
// # …
// # …
func migrateTo4(diskConf yobj) (err error) {
diskConf["schema_version"] = 4
clients, ok, _ := fieldVal[yarr](diskConf, "clients")
if ok {
for i := range clients {
if c, isYobj := clients[i].(yobj); isYobj {
c["use_global_blocked_services"] = true
}
}
}
return nil
}