mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-26 15:37:16 +00:00
Repository tweaks [skip ci]
This commit is contained in:
@@ -20,8 +20,8 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* This repository was automatically generated on Apr 5, 2020 and is NOT
|
||||
* to be modified directly. Any repository modifications are meant to be made to
|
||||
* This repository was automatically generated and is NOT to be modified directly.
|
||||
* Any repository modifications are meant to be made to
|
||||
* the repository extending the base. Any modifications to base repositories are to
|
||||
* be made by the generator only
|
||||
*/
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
|
||||
static std::string PrimaryKey()
|
||||
{
|
||||
return std::string("name");
|
||||
return std::string("charid");
|
||||
}
|
||||
|
||||
static std::vector<std::string> Columns()
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
)
|
||||
{
|
||||
for (auto &friends : friendss) {
|
||||
if (friends.name == friends_id) {
|
||||
if (friends.charid == friends_id) {
|
||||
return friends;
|
||||
}
|
||||
}
|
||||
@@ -172,7 +172,9 @@ public:
|
||||
|
||||
auto columns = Columns();
|
||||
|
||||
|
||||
update_values.push_back(columns[0] + " = " + std::to_string(friends_entry.charid));
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(friends_entry.type));
|
||||
update_values.push_back(columns[2] + " = '" + EscapeString(friends_entry.name) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -180,7 +182,7 @@ public:
|
||||
TableName(),
|
||||
implode(", ", update_values),
|
||||
PrimaryKey(),
|
||||
friends_entry.name
|
||||
friends_entry.charid
|
||||
)
|
||||
);
|
||||
|
||||
@@ -193,7 +195,9 @@ public:
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
|
||||
insert_values.push_back(std::to_string(friends_entry.charid));
|
||||
insert_values.push_back(std::to_string(friends_entry.type));
|
||||
insert_values.push_back("'" + EscapeString(friends_entry.name) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -204,7 +208,7 @@ public:
|
||||
);
|
||||
|
||||
if (results.Success()) {
|
||||
friends_entry.id = results.LastInsertedID();
|
||||
friends_entry.charid = results.LastInsertedID();
|
||||
return friends_entry;
|
||||
}
|
||||
|
||||
@@ -222,7 +226,9 @@ public:
|
||||
for (auto &friends_entry: friends_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
|
||||
insert_values.push_back(std::to_string(friends_entry.charid));
|
||||
insert_values.push_back(std::to_string(friends_entry.type));
|
||||
insert_values.push_back("'" + EscapeString(friends_entry.name) + "'");
|
||||
|
||||
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user