Skip to content

Commit

Permalink
[Repositories] Revert #3976 - fix character corpses
Browse files Browse the repository at this point in the history
  • Loading branch information
Akkadius committed Jan 14, 2024
1 parent 8b7aba2 commit 906879c
Show file tree
Hide file tree
Showing 26 changed files with 191 additions and 184 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [22.43.1] - 1/14/2024

### Repositories

* Revert #3976 - fix character corpses @Akkadius 2024-01-14

## [22.43.0] - 1/14/2024

### Database
Expand Down
10 changes: 5 additions & 5 deletions common/repositories/base/base_account_repository.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ class BaseAccountRepository {
v.push_back(columns[14] + " = '" + Strings::Escape(e.minilogin_ip) + "'");
v.push_back(columns[15] + " = " + std::to_string(e.hideme));
v.push_back(columns[16] + " = " + std::to_string(e.rulesflag));
v.push_back(columns[17] + " = FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "UNIX_TIMESTAMP()") + ")");
v.push_back(columns[17] + " = FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "null") + ")");
v.push_back(columns[18] + " = " + std::to_string(e.time_creation));
v.push_back(columns[19] + " = '" + Strings::Escape(e.ban_reason) + "'");
v.push_back(columns[20] + " = '" + Strings::Escape(e.suspend_reason) + "'");
Expand Down Expand Up @@ -325,7 +325,7 @@ class BaseAccountRepository {
v.push_back("'" + Strings::Escape(e.minilogin_ip) + "'");
v.push_back(std::to_string(e.hideme));
v.push_back(std::to_string(e.rulesflag));
v.push_back("FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "null") + ")");
v.push_back(std::to_string(e.time_creation));
v.push_back("'" + Strings::Escape(e.ban_reason) + "'");
v.push_back("'" + Strings::Escape(e.suspend_reason) + "'");
Expand Down Expand Up @@ -378,7 +378,7 @@ class BaseAccountRepository {
v.push_back("'" + Strings::Escape(e.minilogin_ip) + "'");
v.push_back(std::to_string(e.hideme));
v.push_back(std::to_string(e.rulesflag));
v.push_back("FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "null") + ")");
v.push_back(std::to_string(e.time_creation));
v.push_back("'" + Strings::Escape(e.ban_reason) + "'");
v.push_back("'" + Strings::Escape(e.suspend_reason) + "'");
Expand Down Expand Up @@ -581,7 +581,7 @@ class BaseAccountRepository {
v.push_back("'" + Strings::Escape(e.minilogin_ip) + "'");
v.push_back(std::to_string(e.hideme));
v.push_back(std::to_string(e.rulesflag));
v.push_back("FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "null") + ")");
v.push_back(std::to_string(e.time_creation));
v.push_back("'" + Strings::Escape(e.ban_reason) + "'");
v.push_back("'" + Strings::Escape(e.suspend_reason) + "'");
Expand Down Expand Up @@ -627,7 +627,7 @@ class BaseAccountRepository {
v.push_back("'" + Strings::Escape(e.minilogin_ip) + "'");
v.push_back(std::to_string(e.hideme));
v.push_back(std::to_string(e.rulesflag));
v.push_back("FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "null") + ")");
v.push_back(std::to_string(e.time_creation));
v.push_back("'" + Strings::Escape(e.ban_reason) + "'");
v.push_back("'" + Strings::Escape(e.suspend_reason) + "'");
Expand Down
20 changes: 10 additions & 10 deletions common/repositories/base/base_bug_reports_repository.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,9 @@ class BaseBugReportsRepository {
v.push_back(columns[24] + " = " + std::to_string(e._unknown_value));
v.push_back(columns[25] + " = '" + Strings::Escape(e.bug_report) + "'");
v.push_back(columns[26] + " = '" + Strings::Escape(e.system_info) + "'");
v.push_back(columns[27] + " = FROM_UNIXTIME(" + (e.report_datetime > 0 ? std::to_string(e.report_datetime) : "UNIX_TIMESTAMP()") + ")");
v.push_back(columns[27] + " = FROM_UNIXTIME(" + (e.report_datetime > 0 ? std::to_string(e.report_datetime) : "null") + ")");
v.push_back(columns[28] + " = " + std::to_string(e.bug_status));
v.push_back(columns[29] + " = FROM_UNIXTIME(" + (e.last_review > 0 ? std::to_string(e.last_review) : "UNIX_TIMESTAMP()") + ")");
v.push_back(columns[29] + " = FROM_UNIXTIME(" + (e.last_review > 0 ? std::to_string(e.last_review) : "null") + ")");
v.push_back(columns[30] + " = '" + Strings::Escape(e.last_reviewer) + "'");
v.push_back(columns[31] + " = '" + Strings::Escape(e.reviewer_notes) + "'");

Expand Down Expand Up @@ -383,9 +383,9 @@ class BaseBugReportsRepository {
v.push_back(std::to_string(e._unknown_value));
v.push_back("'" + Strings::Escape(e.bug_report) + "'");
v.push_back("'" + Strings::Escape(e.system_info) + "'");
v.push_back("FROM_UNIXTIME(" + (e.report_datetime > 0 ? std::to_string(e.report_datetime) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.report_datetime > 0 ? std::to_string(e.report_datetime) : "null") + ")");
v.push_back(std::to_string(e.bug_status));
v.push_back("FROM_UNIXTIME(" + (e.last_review > 0 ? std::to_string(e.last_review) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.last_review > 0 ? std::to_string(e.last_review) : "null") + ")");
v.push_back("'" + Strings::Escape(e.last_reviewer) + "'");
v.push_back("'" + Strings::Escape(e.reviewer_notes) + "'");

Expand Down Expand Up @@ -444,9 +444,9 @@ class BaseBugReportsRepository {
v.push_back(std::to_string(e._unknown_value));
v.push_back("'" + Strings::Escape(e.bug_report) + "'");
v.push_back("'" + Strings::Escape(e.system_info) + "'");
v.push_back("FROM_UNIXTIME(" + (e.report_datetime > 0 ? std::to_string(e.report_datetime) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.report_datetime > 0 ? std::to_string(e.report_datetime) : "null") + ")");
v.push_back(std::to_string(e.bug_status));
v.push_back("FROM_UNIXTIME(" + (e.last_review > 0 ? std::to_string(e.last_review) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.last_review > 0 ? std::to_string(e.last_review) : "null") + ")");
v.push_back("'" + Strings::Escape(e.last_reviewer) + "'");
v.push_back("'" + Strings::Escape(e.reviewer_notes) + "'");

Expand Down Expand Up @@ -671,9 +671,9 @@ class BaseBugReportsRepository {
v.push_back(std::to_string(e._unknown_value));
v.push_back("'" + Strings::Escape(e.bug_report) + "'");
v.push_back("'" + Strings::Escape(e.system_info) + "'");
v.push_back("FROM_UNIXTIME(" + (e.report_datetime > 0 ? std::to_string(e.report_datetime) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.report_datetime > 0 ? std::to_string(e.report_datetime) : "null") + ")");
v.push_back(std::to_string(e.bug_status));
v.push_back("FROM_UNIXTIME(" + (e.last_review > 0 ? std::to_string(e.last_review) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.last_review > 0 ? std::to_string(e.last_review) : "null") + ")");
v.push_back("'" + Strings::Escape(e.last_reviewer) + "'");
v.push_back("'" + Strings::Escape(e.reviewer_notes) + "'");

Expand Down Expand Up @@ -725,9 +725,9 @@ class BaseBugReportsRepository {
v.push_back(std::to_string(e._unknown_value));
v.push_back("'" + Strings::Escape(e.bug_report) + "'");
v.push_back("'" + Strings::Escape(e.system_info) + "'");
v.push_back("FROM_UNIXTIME(" + (e.report_datetime > 0 ? std::to_string(e.report_datetime) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.report_datetime > 0 ? std::to_string(e.report_datetime) : "null") + ")");
v.push_back(std::to_string(e.bug_status));
v.push_back("FROM_UNIXTIME(" + (e.last_review > 0 ? std::to_string(e.last_review) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.last_review > 0 ? std::to_string(e.last_review) : "null") + ")");
v.push_back("'" + Strings::Escape(e.last_reviewer) + "'");
v.push_back("'" + Strings::Escape(e.reviewer_notes) + "'");

Expand Down
10 changes: 5 additions & 5 deletions common/repositories/base/base_character_corpses_repository.h
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ class BaseCharacterCorpsesRepository {
v.push_back(columns[6] + " = " + std::to_string(e.y));
v.push_back(columns[7] + " = " + std::to_string(e.z));
v.push_back(columns[8] + " = " + std::to_string(e.heading));
v.push_back(columns[9] + " = FROM_UNIXTIME(" + (e.time_of_death > 0 ? std::to_string(e.time_of_death) : "UNIX_TIMESTAMP()") + ")");
v.push_back(columns[9] + " = FROM_UNIXTIME(" + (e.time_of_death > 0 ? std::to_string(e.time_of_death) : "null") + ")");
v.push_back(columns[10] + " = " + std::to_string(e.guild_consent_id));
v.push_back(columns[11] + " = " + std::to_string(e.is_rezzed));
v.push_back(columns[12] + " = " + std::to_string(e.is_buried));
Expand Down Expand Up @@ -455,7 +455,7 @@ class BaseCharacterCorpsesRepository {
v.push_back(std::to_string(e.y));
v.push_back(std::to_string(e.z));
v.push_back(std::to_string(e.heading));
v.push_back("FROM_UNIXTIME(" + (e.time_of_death > 0 ? std::to_string(e.time_of_death) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.time_of_death > 0 ? std::to_string(e.time_of_death) : "null") + ")");
v.push_back(std::to_string(e.guild_consent_id));
v.push_back(std::to_string(e.is_rezzed));
v.push_back(std::to_string(e.is_buried));
Expand Down Expand Up @@ -531,7 +531,7 @@ class BaseCharacterCorpsesRepository {
v.push_back(std::to_string(e.y));
v.push_back(std::to_string(e.z));
v.push_back(std::to_string(e.heading));
v.push_back("FROM_UNIXTIME(" + (e.time_of_death > 0 ? std::to_string(e.time_of_death) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.time_of_death > 0 ? std::to_string(e.time_of_death) : "null") + ")");
v.push_back(std::to_string(e.guild_consent_id));
v.push_back(std::to_string(e.is_rezzed));
v.push_back(std::to_string(e.is_buried));
Expand Down Expand Up @@ -803,7 +803,7 @@ class BaseCharacterCorpsesRepository {
v.push_back(std::to_string(e.y));
v.push_back(std::to_string(e.z));
v.push_back(std::to_string(e.heading));
v.push_back("FROM_UNIXTIME(" + (e.time_of_death > 0 ? std::to_string(e.time_of_death) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.time_of_death > 0 ? std::to_string(e.time_of_death) : "null") + ")");
v.push_back(std::to_string(e.guild_consent_id));
v.push_back(std::to_string(e.is_rezzed));
v.push_back(std::to_string(e.is_buried));
Expand Down Expand Up @@ -872,7 +872,7 @@ class BaseCharacterCorpsesRepository {
v.push_back(std::to_string(e.y));
v.push_back(std::to_string(e.z));
v.push_back(std::to_string(e.heading));
v.push_back("FROM_UNIXTIME(" + (e.time_of_death > 0 ? std::to_string(e.time_of_death) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.time_of_death > 0 ? std::to_string(e.time_of_death) : "null") + ")");
v.push_back(std::to_string(e.guild_consent_id));
v.push_back(std::to_string(e.is_rezzed));
v.push_back(std::to_string(e.is_buried));
Expand Down
10 changes: 5 additions & 5 deletions common/repositories/base/base_character_data_repository.h
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ class BaseCharacterDataRepository {
v.push_back(columns[99] + " = " + std::to_string(e.aa_points_spent_old));
v.push_back(columns[100] + " = " + std::to_string(e.aa_points_old));
v.push_back(columns[101] + " = " + std::to_string(e.e_last_invsnapshot));
v.push_back(columns[102] + " = FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "UNIX_TIMESTAMP()") + ")");
v.push_back(columns[102] + " = FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");

auto results = db.QueryDatabase(
fmt::format(
Expand Down Expand Up @@ -884,7 +884,7 @@ class BaseCharacterDataRepository {
v.push_back(std::to_string(e.aa_points_spent_old));
v.push_back(std::to_string(e.aa_points_old));
v.push_back(std::to_string(e.e_last_invsnapshot));
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");

auto results = db.QueryDatabase(
fmt::format(
Expand Down Expand Up @@ -1016,7 +1016,7 @@ class BaseCharacterDataRepository {
v.push_back(std::to_string(e.aa_points_spent_old));
v.push_back(std::to_string(e.aa_points_old));
v.push_back(std::to_string(e.e_last_invsnapshot));
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");

insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
}
Expand Down Expand Up @@ -1456,7 +1456,7 @@ class BaseCharacterDataRepository {
v.push_back(std::to_string(e.aa_points_spent_old));
v.push_back(std::to_string(e.aa_points_old));
v.push_back(std::to_string(e.e_last_invsnapshot));
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");

auto results = db.QueryDatabase(
fmt::format(
Expand Down Expand Up @@ -1581,7 +1581,7 @@ class BaseCharacterDataRepository {
v.push_back(std::to_string(e.aa_points_spent_old));
v.push_back(std::to_string(e.aa_points_old));
v.push_back(std::to_string(e.e_last_invsnapshot));
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");

insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class BaseCharacterExpeditionLockoutsRepository {
v.push_back(columns[1] + " = " + std::to_string(e.character_id));
v.push_back(columns[2] + " = '" + Strings::Escape(e.expedition_name) + "'");
v.push_back(columns[3] + " = '" + Strings::Escape(e.event_name) + "'");
v.push_back(columns[4] + " = FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
v.push_back(columns[4] + " = FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
v.push_back(columns[5] + " = " + std::to_string(e.duration));
v.push_back(columns[6] + " = '" + Strings::Escape(e.from_expedition_uuid) + "'");

Expand Down Expand Up @@ -210,7 +210,7 @@ class BaseCharacterExpeditionLockoutsRepository {
v.push_back(std::to_string(e.character_id));
v.push_back("'" + Strings::Escape(e.expedition_name) + "'");
v.push_back("'" + Strings::Escape(e.event_name) + "'");
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
v.push_back(std::to_string(e.duration));
v.push_back("'" + Strings::Escape(e.from_expedition_uuid) + "'");

Expand Down Expand Up @@ -246,7 +246,7 @@ class BaseCharacterExpeditionLockoutsRepository {
v.push_back(std::to_string(e.character_id));
v.push_back("'" + Strings::Escape(e.expedition_name) + "'");
v.push_back("'" + Strings::Escape(e.event_name) + "'");
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
v.push_back(std::to_string(e.duration));
v.push_back("'" + Strings::Escape(e.from_expedition_uuid) + "'");

Expand Down Expand Up @@ -398,7 +398,7 @@ class BaseCharacterExpeditionLockoutsRepository {
v.push_back(std::to_string(e.character_id));
v.push_back("'" + Strings::Escape(e.expedition_name) + "'");
v.push_back("'" + Strings::Escape(e.event_name) + "'");
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
v.push_back(std::to_string(e.duration));
v.push_back("'" + Strings::Escape(e.from_expedition_uuid) + "'");

Expand Down Expand Up @@ -427,7 +427,7 @@ class BaseCharacterExpeditionLockoutsRepository {
v.push_back(std::to_string(e.character_id));
v.push_back("'" + Strings::Escape(e.expedition_name) + "'");
v.push_back("'" + Strings::Escape(e.event_name) + "'");
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
v.push_back(std::to_string(e.duration));
v.push_back("'" + Strings::Escape(e.from_expedition_uuid) + "'");

Expand Down
20 changes: 10 additions & 10 deletions common/repositories/base/base_character_stats_record_repository.h
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,8 @@ class BaseCharacterStatsRecordRepository {
v.push_back(columns[69] + " = " + std::to_string(e.alcohol));
v.push_back(columns[70] + " = " + std::to_string(e.fishing));
v.push_back(columns[71] + " = " + std::to_string(e.tinkering));
v.push_back(columns[72] + " = FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
v.push_back(columns[73] + " = FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "UNIX_TIMESTAMP()") + ")");
v.push_back(columns[72] + " = FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
v.push_back(columns[73] + " = FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "null") + ")");

auto results = db.QueryDatabase(
fmt::format(
Expand Down Expand Up @@ -681,8 +681,8 @@ class BaseCharacterStatsRecordRepository {
v.push_back(std::to_string(e.alcohol));
v.push_back(std::to_string(e.fishing));
v.push_back(std::to_string(e.tinkering));
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "null") + ")");

auto results = db.QueryDatabase(
fmt::format(
Expand Down Expand Up @@ -784,8 +784,8 @@ class BaseCharacterStatsRecordRepository {
v.push_back(std::to_string(e.alcohol));
v.push_back(std::to_string(e.fishing));
v.push_back(std::to_string(e.tinkering));
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "null") + ")");

insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
}
Expand Down Expand Up @@ -1137,8 +1137,8 @@ class BaseCharacterStatsRecordRepository {
v.push_back(std::to_string(e.alcohol));
v.push_back(std::to_string(e.fishing));
v.push_back(std::to_string(e.tinkering));
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "null") + ")");

auto results = db.QueryDatabase(
fmt::format(
Expand Down Expand Up @@ -1233,8 +1233,8 @@ class BaseCharacterStatsRecordRepository {
v.push_back(std::to_string(e.alcohol));
v.push_back(std::to_string(e.fishing));
v.push_back(std::to_string(e.tinkering));
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "UNIX_TIMESTAMP()") + ")");
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "null") + ")");

insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
}
Expand Down
Loading

0 comments on commit 906879c

Please sign in to comment.