mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-25 15:07:28 +00:00
14 lines
521 B
C++
14 lines
521 B
C++
|
#include "MySQLDatabase.h"
|
||
|
|
||
|
void MySQLDatabase::CreateMigrationHistoryTable() {
|
||
|
ExecuteInsert("CREATE TABLE IF NOT EXISTS migration_history (name TEXT NOT NULL, date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP());");
|
||
|
}
|
||
|
|
||
|
bool MySQLDatabase::IsMigrationRun(const std::string_view str) {
|
||
|
return ExecuteSelect("SELECT name FROM migration_history WHERE name = ?;", str)->next();
|
||
|
}
|
||
|
|
||
|
void MySQLDatabase::InsertMigration(const std::string_view str) {
|
||
|
ExecuteInsert("INSERT INTO migration_history (name) VALUES (?);", str);
|
||
|
}
|