feat(Core/DBUpdater): implement db auto update (#6576)

* feat(Core/DBUpdater): implement db auto update

* 1

* 2

* 3

* Some minor improvements

* add find bin for mysql 8.0

* lic

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
Kargatum
2021-06-27 23:59:44 +07:00
committed by GitHub
parent ccd73918ae
commit 2d2857ce81
25 changed files with 929 additions and 79 deletions

View File

@@ -55,6 +55,7 @@ private:
enum State
{
RELEASED,
CUSTOM,
ARCHIVED
};
@@ -64,21 +65,33 @@ private:
: name(name_), hash(hash_), state(state_), timestamp(timestamp_) { }
std::string const name;
std::string const hash;
State const state;
uint64 const timestamp;
static inline State StateConvert(std::string const& state)
{
return (state == "RELEASED") ? RELEASED : ARCHIVED;
if (state == "RELEASED")
return RELEASED;
else if (state == "CUSTOM")
return CUSTOM;
return ARCHIVED;
}
static inline std::string StateConvert(State const state)
{
return (state == RELEASED) ? "RELEASED" : "ARCHIVED";
switch (state)
{
case RELEASED:
return "RELEASED";
case CUSTOM:
return "CUSTOM";
case ARCHIVED:
return "ARCHIVED";
default:
return "";
}
}
std::string GetStateAsString() const