Implement a migration runner

This commit is contained in:
Jett
2022-07-10 20:40:26 +01:00
parent 325dc5a571
commit d642de9462
11 changed files with 208 additions and 27 deletions

View File

@@ -19,6 +19,7 @@
#include "CDClientDatabase.h"
#include "CDClientManager.h"
#include "Database.h"
#include "MigrationRunner.h"
#include "Diagnostics.h"
#include "dCommonVars.h"
#include "dConfig.h"
@@ -127,6 +128,13 @@ int main(int argc, char** argv) {
return EXIT_FAILURE;
}
if (argc > 1 && (strcmp(argv[1], "-m") == 0 || strcmp(argv[1], "--migrations") == 0)) {
MigrationRunner::RunMigrations();
Game::logger->Log("MigrationRunner", "Finished running migrations\n");
return EXIT_SUCCESS;
}
//If the first command line argument is -a or --account then make the user
//input a username and password, with the password being hidden.
if (argc > 1 &&