diff options
author | Sadie Powell <sadie@witchery.services> | 2025-03-12 10:29:11 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2025-03-12 15:53:52 +0000 |
commit | cdcf0e2f9a8fb0e1c363fc65f71f3131fc6c5ea5 (patch) | |
tree | 3a665673235bb4dea58b99474492d90e0f711697 /modules/database/db_sql_live.cpp | |
parent | 718f2e922a6e1113d66fc6e96131213942d507b2 (diff) |
Move serialization from Serializable to a Serialize::Type child.
Diffstat (limited to 'modules/database/db_sql_live.cpp')
-rw-r--r-- | modules/database/db_sql_live.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/database/db_sql_live.cpp b/modules/database/db_sql_live.cpp index afd884913..9389e5a59 100644 --- a/modules/database/db_sql_live.cpp +++ b/modules/database/db_sql_live.cpp @@ -93,18 +93,18 @@ public: { if (obj && this->SQL) { + Serialize::Type *s_type = obj->GetSerializableType(); + if (!s_type) + continue; + Data data; - obj->Serialize(data); + s_type->Serialize(obj, data); if (obj->IsCached(data)) continue; obj->UpdateCache(data); - Serialize::Type *s_type = obj->GetSerializableType(); - if (!s_type) - continue; - auto create = this->SQL->CreateTable(GetTableName(s_type), data); for (const auto &query : create) this->RunQuery(query); @@ -232,7 +232,7 @@ public: */ Data data2; - new_s->Serialize(data2); + obj->Serialize(new_s, data2); new_s->UpdateCache(data2); /* We know this is the most up to date copy */ } } |