diff options
-rw-r--r-- | include/serialize.h | 2 | ||||
-rw-r--r-- | modules/database/db_json.cpp | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/include/serialize.h b/include/serialize.h index 79315d7a9..f4276bebd 100644 --- a/include/serialize.h +++ b/include/serialize.h @@ -98,6 +98,8 @@ private: Serialize::Type *s_type; /* Iterator into serializable_items */ std::list<Serializable *>::iterator s_iter; + /** The time at which this object was first committed to the database. */ + time_t first_commit = 0; /* The hash of the last serialized form of this object committed to the database */ size_t last_commit = 0; /* The last time this object was committed to the database */ diff --git a/modules/database/db_json.cpp b/modules/database/db_json.cpp index a43acc36b..7d556a0fc 100644 --- a/modules/database/db_json.cpp +++ b/modules/database/db_json.cpp @@ -61,7 +61,7 @@ public: continue; Anope::string akey(yyjson_mut_get_str(key)); - if (akey.equals_ci("id")) + if (akey.equals_ci("@id")) { this->id = yyjson_mut_get_uint(value); continue; @@ -354,7 +354,7 @@ public: auto *elem = yyjson_mut_arr_add_obj(doc, type); if (item->id) - yyjson_mut_obj_add_uint(doc, elem, "id", item->id); + yyjson_mut_obj_add_uint(doc, elem, "@id", item->id); Data sd; s_type->Serialize(item, sd); |