Throw error instead of silently skipping CA migration.

This commit is contained in:
Ben Radford 2023-05-18 13:47:31 +01:00
parent d55e38b98a
commit 8ffeb1c4e5
No known key found for this signature in database
GPG key ID: 9DF5D4640AB888D5

View file

@ -355,8 +355,12 @@ LocalStore::LocalStore(const Params & params)
else openDB(*state, false); else openDB(*state, false);
if (!readOnly && experimentalFeatureSettings.isEnabled(Xp::CaDerivations)) { if (experimentalFeatureSettings.isEnabled(Xp::CaDerivations)) {
migrateCASchema(state->db, dbDir + "/ca-schema", globalLock); if (!readOnly) {
migrateCASchema(state->db, dbDir + "/ca-schema", globalLock);
} else {
throw Error("need to migrate to CA schema, but this cannot be done in read-only mode");
}
} }
/* Prepare SQL statements. */ /* Prepare SQL statements. */