change default for bcc_self, preserve values for existing installations

This commit is contained in:
B. Petersen
2019-11-11 22:55:19 +01:00
committed by holger krekel
parent 85b4817a1e
commit dabd431b1f
2 changed files with 8 additions and 2 deletions

View File

@@ -804,9 +804,15 @@ fn open(
"ALTER TABLE locations ADD COLUMN independent INTEGER DEFAULT 0;",
params![],
)?;
sql.set_raw_config_int(context, "dbversion", 55)?;
}
if dbversion < 56 {
info!(context, "[migration] v56");
if exists_before_update && sql.get_raw_config_int(context, "bcc_self").is_none() {
sql.set_raw_config_int(context, "bcc_self", 1)?;
}
sql.set_raw_config_int(context, "dbversion", 56)?;
}
// (2) updates that require high-level objects
// (the structure is complete now and all objects are usable)