Migrations only flag (#1773)

This commit is contained in:
Wincent Holm 2025-04-19 02:38:08 +02:00 committed by GitHub
parent 6b0f3a66e9
commit fa53fa7935
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -213,6 +213,13 @@ int main(int argc, char** argv) {
// Run migrations should any need to be run. // Run migrations should any need to be run.
MigrationRunner::RunSQLiteMigrations(); MigrationRunner::RunSQLiteMigrations();
// Check for the --migrations-only flag
if ((argc > 1 &&
(strcmp(argv[1], "--migrations-only") == 0 || strcmp(argv[1], "-m") == 0))) {
LOG("Migrations only flag detected. Exiting.");
return EXIT_SUCCESS;
}
//If the first command line argument is -a or --account then make the user //If the first command line argument is -a or --account then make the user
//input a username and password, with the password being hidden. //input a username and password, with the password being hidden.
bool createAccount = Database::Get()->GetAccountCount() == 0 && Game::config->GetValue("skip_account_creation") != "1"; bool createAccount = Database::Get()->GetAccountCount() == 0 && Game::config->GetValue("skip_account_creation") != "1";