Add Truncate repository method and purge player sold items on world bootup

This commit is contained in:
Akkadius
2020-04-18 23:53:52 -05:00
parent 85daee85b8
commit caa0ffda00
310 changed files with 2470 additions and 474 deletions
@@ -323,7 +323,6 @@ public:
fmt::format(
"DELETE FROM {} WHERE {}",
TableName(),
PrimaryKey(),
where_filter
)
);
@@ -331,6 +330,18 @@ public:
return (results.Success() ? results.RowsAffected() : 0);
}
static int Truncate()
{
auto results = database.QueryDatabase(
fmt::format(
"TRUNCATE TABLE {}",
TableName()
)
);
return (results.Success() ? results.RowsAffected() : 0);
}
};
#endif //EQEMU_BASE_CHARACTER_ACTIVITIES_REPOSITORY_H