mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-24 09:28:21 +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("type");
|
||||
return std::string("id");
|
||||
}
|
||||
|
||||
static std::vector<std::string> Columns()
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
)
|
||||
{
|
||||
for (auto &db_str : db_strs) {
|
||||
if (db_str.type == db_str_id) {
|
||||
if (db_str.id == db_str_id) {
|
||||
return db_str;
|
||||
}
|
||||
}
|
||||
@@ -172,6 +172,8 @@ public:
|
||||
|
||||
auto columns = Columns();
|
||||
|
||||
update_values.push_back(columns[0] + " = " + std::to_string(db_str_entry.id));
|
||||
update_values.push_back(columns[1] + " = " + std::to_string(db_str_entry.type));
|
||||
update_values.push_back(columns[2] + " = '" + EscapeString(db_str_entry.value) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
@@ -180,7 +182,7 @@ public:
|
||||
TableName(),
|
||||
implode(", ", update_values),
|
||||
PrimaryKey(),
|
||||
db_str_entry.type
|
||||
db_str_entry.id
|
||||
)
|
||||
);
|
||||
|
||||
@@ -193,6 +195,8 @@ public:
|
||||
{
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(db_str_entry.id));
|
||||
insert_values.push_back(std::to_string(db_str_entry.type));
|
||||
insert_values.push_back("'" + EscapeString(db_str_entry.value) + "'");
|
||||
|
||||
auto results = database.QueryDatabase(
|
||||
@@ -222,6 +226,8 @@ public:
|
||||
for (auto &db_str_entry: db_str_entries) {
|
||||
std::vector<std::string> insert_values;
|
||||
|
||||
insert_values.push_back(std::to_string(db_str_entry.id));
|
||||
insert_values.push_back(std::to_string(db_str_entry.type));
|
||||
insert_values.push_back("'" + EscapeString(db_str_entry.value) + "'");
|
||||
|
||||
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
|
||||
|
||||
Reference in New Issue
Block a user