diff --git a/common/database_schema.h b/common/database_schema.h index ad0b227cb..2abb10b8c 100644 --- a/common/database_schema.h +++ b/common/database_schema.h @@ -50,6 +50,7 @@ namespace DatabaseSchema { {"character_data", "id"}, {"character_disciplines", "id"}, {"character_enabledtasks", "charid"}, + {"character_expedition_lockouts", "character_id"}, {"character_inspect_messages", "id"}, {"character_item_recast", "id"}, {"character_languages", "id"}, @@ -66,7 +67,6 @@ namespace DatabaseSchema { {"character_tribute", "id"}, {"completed_tasks", "charid"}, {"data_buckets", "id"}, - {"expedition_character_lockouts", "character_id"}, {"faction_values", "char_id"}, {"friends", "charid"}, {"guild_members", "char_id"}, @@ -115,6 +115,7 @@ namespace DatabaseSchema { "character_data", "character_disciplines", "character_enabledtasks", + "character_expedition_lockouts", "character_inspect_messages", "character_item_recast", "character_languages", @@ -132,7 +133,6 @@ namespace DatabaseSchema { "completed_tasks", "data_buckets", "discovered_items", - "expedition_character_lockouts", "faction_values", "friends", "guild_bank", diff --git a/utils/sql/git/required/wip_expeditions.sql b/utils/sql/git/required/wip_expeditions.sql index fe92bb2b4..f3e2598c9 100644 --- a/utils/sql/git/required/wip_expeditions.sql +++ b/utils/sql/git/required/wip_expeditions.sql @@ -40,7 +40,7 @@ COLLATE='utf8mb4_general_ci' ENGINE=InnoDB ; -CREATE TABLE `expedition_character_lockouts` ( +CREATE TABLE `character_expedition_lockouts` ( `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `character_id` INT(10) UNSIGNED NOT NULL, `expedition_name` VARCHAR(128) NOT NULL, diff --git a/world/expedition.cpp b/world/expedition.cpp index f06f61a7c..b88417e85 100644 --- a/world/expedition.cpp +++ b/world/expedition.cpp @@ -287,7 +287,7 @@ void ExpeditionDatabase::PurgeExpiredExpeditions() void ExpeditionDatabase::PurgeExpiredCharacterLockouts() { std::string query = SQL( - DELETE FROM expedition_character_lockouts + DELETE FROM character_expedition_lockouts WHERE expire_time <= NOW(); ); diff --git a/zone/expedition_database.cpp b/zone/expedition_database.cpp index 001f46730..ca25357bc 100644 --- a/zone/expedition_database.cpp +++ b/zone/expedition_database.cpp @@ -109,7 +109,7 @@ std::vector ExpeditionDatabase::LoadCharacterLockouts(ui event_name, UNIX_TIMESTAMP(expire_time), duration - FROM expedition_character_lockouts + FROM character_expedition_lockouts WHERE character_id = {} AND is_pending = FALSE AND expire_time > NOW(); ), character_id); @@ -144,7 +144,7 @@ std::vector ExpeditionDatabase::LoadCharacterLockouts( event_name, UNIX_TIMESTAMP(expire_time), duration - FROM expedition_character_lockouts + FROM character_expedition_lockouts WHERE character_id = {} AND is_pending = FALSE @@ -254,7 +254,7 @@ MySQLRequestResult ExpeditionDatabase::LoadMembersForCreateRequest( lockout.duration, lockout.event_name FROM character_data - LEFT JOIN expedition_character_lockouts lockout + LEFT JOIN character_expedition_lockouts lockout ON character_data.id = lockout.character_id AND lockout.is_pending = FALSE AND lockout.expire_time > NOW() @@ -277,7 +277,7 @@ void ExpeditionDatabase::DeleteAllCharacterLockouts(uint32_t character_id) if (character_id != 0) { std::string query = fmt::format(SQL( - DELETE FROM expedition_character_lockouts + DELETE FROM character_expedition_lockouts WHERE character_id = {}; ), character_id); @@ -293,7 +293,7 @@ void ExpeditionDatabase::DeleteAllCharacterLockouts( if (character_id != 0 && !expedition_name.empty()) { std::string query = fmt::format(SQL( - DELETE FROM expedition_character_lockouts + DELETE FROM character_expedition_lockouts WHERE character_id = {} AND expedition_name = '{}'; ), character_id, EscapeString(expedition_name)); @@ -309,7 +309,7 @@ void ExpeditionDatabase::DeleteCharacterLockout( ); auto query = fmt::format(SQL( - DELETE FROM expedition_character_lockouts + DELETE FROM character_expedition_lockouts WHERE character_id = {} AND is_pending = FALSE @@ -337,7 +337,7 @@ void ExpeditionDatabase::DeleteMembersLockout( query_character_ids.pop_back(); // trailing comma auto query = fmt::format(SQL( - DELETE FROM expedition_character_lockouts + DELETE FROM character_expedition_lockouts WHERE character_id IN ({}) AND is_pending = FALSE @@ -354,7 +354,7 @@ void ExpeditionDatabase::AssignPendingLockouts(uint32_t character_id, const std: LogExpeditionsDetail("Assigning character [{}] pending lockouts [{}]", character_id, expedition_name); auto query = fmt::format(SQL( - UPDATE expedition_character_lockouts + UPDATE character_expedition_lockouts SET is_pending = FALSE WHERE character_id = {} @@ -370,7 +370,7 @@ void ExpeditionDatabase::DeletePendingLockouts(uint32_t character_id) LogExpeditionsDetail("Deleting character [{}] pending lockouts", character_id); auto query = fmt::format(SQL( - DELETE FROM expedition_character_lockouts + DELETE FROM character_expedition_lockouts WHERE character_id = {} AND is_pending = TRUE; ), character_id); @@ -392,7 +392,7 @@ void ExpeditionDatabase::DeleteAllMembersPendingLockouts(const std::vector& insert_values.pop_back(); // trailing comma auto query = fmt::format(SQL( - INSERT INTO expedition_character_lockouts + INSERT INTO character_expedition_lockouts (character_id, expire_time, duration, from_expedition_uuid, expedition_name, event_name) VALUES {} ON DUPLICATE KEY UPDATE