|
|
@@ -352,7 +352,7 @@ bool MigrationRunner::applyOperation(const nlohmann::json& operation) {
|
|
|
|
|
|
Document doc;
|
|
|
doc.id = id;
|
|
|
- doc.data = operation["data"];
|
|
|
+ doc.set_data(operation["data"]);
|
|
|
|
|
|
try {
|
|
|
store_.insert(collection, doc);
|
|
|
@@ -381,7 +381,7 @@ bool MigrationRunner::applyOperation(const nlohmann::json& operation) {
|
|
|
|
|
|
Document doc;
|
|
|
doc.id = id;
|
|
|
- doc.data = operation["data"];
|
|
|
+ doc.set_data(operation["data"]);
|
|
|
|
|
|
try {
|
|
|
store_.insert(collection, doc);
|
|
|
@@ -404,7 +404,7 @@ bool MigrationRunner::applyOperation(const nlohmann::json& operation) {
|
|
|
|
|
|
Document doc;
|
|
|
doc.id = id;
|
|
|
- doc.data = operation["data"];
|
|
|
+ doc.set_data(operation["data"]);
|
|
|
|
|
|
store_.upsert(collection, doc);
|
|
|
spdlog::debug("upsert into '{}': {}", collection, doc.id);
|
|
|
@@ -422,7 +422,7 @@ bool MigrationRunner::applyOperation(const nlohmann::json& operation) {
|
|
|
|
|
|
Document doc;
|
|
|
doc.id = id;
|
|
|
- doc.data = operation["data"];
|
|
|
+ doc.set_data(operation["data"]);
|
|
|
|
|
|
bool updated = store_.update(collection, id, doc);
|
|
|
spdlog::debug("update '{}': {} ({})", id, updated ? "updated" : "not found",
|
|
|
@@ -567,7 +567,7 @@ bool MigrationRunner::applyOperation(const nlohmann::json& operation) {
|
|
|
|
|
|
Document doc;
|
|
|
doc.id = key;
|
|
|
- doc.data = nlohmann::json{{"value", value_to_write}};
|
|
|
+ doc.set_data(nlohmann::json{{"value", value_to_write}});
|
|
|
store_.upsert(collection, doc);
|
|
|
spdlog::debug("upsert_setting '{}/{}' = '{}' (fresh_install={})",
|
|
|
collection, key, value_to_write, fresh_install_at_start_);
|
|
|
@@ -611,7 +611,7 @@ bool MigrationRunner::applyOperation(const nlohmann::json& operation) {
|
|
|
|
|
|
Document doc;
|
|
|
doc.id = key;
|
|
|
- doc.data = nlohmann::json{{"value", hex.str()}};
|
|
|
+ doc.set_data(nlohmann::json{{"value", hex.str()}});
|
|
|
store_.upsert(collection, doc);
|
|
|
spdlog::info("generate_secret '{}/{}': {}-byte secret generated", collection, key, bytes);
|
|
|
return true;
|
|
|
@@ -631,14 +631,14 @@ void MigrationRunner::recordMigration(const std::string& version, const std::str
|
|
|
|
|
|
Document doc;
|
|
|
doc.id = id;
|
|
|
- doc.data = {
|
|
|
+ doc.set_data(nlohmann::json{
|
|
|
{"version", version},
|
|
|
{"name", name},
|
|
|
{"applied_at", std::chrono::duration_cast<std::chrono::milliseconds>(
|
|
|
std::chrono::system_clock::now().time_since_epoch()).count()},
|
|
|
{"status", "applied"},
|
|
|
{"checksum", checksum}
|
|
|
- };
|
|
|
+ });
|
|
|
|
|
|
store_.insert(MIGRATIONS_COLLECTION, doc);
|
|
|
}
|