tom used move for DM

This commit is contained in:
silverqx
2022-08-16 20:38:20 +02:00
parent c86bc6a48f
commit 39388abc47
2 changed files with 4 additions and 3 deletions

View File

@@ -27,7 +27,7 @@ int main(int argc, char *argv[])
// Ownership of the shared_ptr()
auto db = setupManager();
return TomApplication(argc, argv, db, "TOM_EXAMPLE_ENV",
return TomApplication(argc, argv, std::move(db), "TOM_EXAMPLE_ENV",
QStringLiteral("migrations_example"))
/* Default migrations path for the make:migration command, the path
can be absolute or relative (to the pwd at runtime). */
@@ -120,7 +120,8 @@ std::shared_ptr<DatabaseManager> setupManager()
}
/* Alternative syntax to instantiate migration classes. */
// return TomApplication(argc, argv, db, "TOM_EXAMPLE_ENV",
// return TomApplication(argc, argv, std::move(db), "TOM_EXAMPLE_ENV",
// QStringLiteral("migrations_table")
// {
// std::make_shared<CreatePostsTable>(),
// std::make_shared<AddFactorColumnToPostsTable>(),

View File

@@ -36,7 +36,7 @@ int main(int argc, char *argv[])
// Ownership of the shared_ptr()
auto db = setupManager();
return TomApplication(argc, argv, db, "TOM_TESTDATA_ENV")
return TomApplication(argc, argv, std::move(db), "TOM_TESTDATA_ENV")
// TODO tests, add migration for createDatabase if not exists and remove DB creation from the workflows? silverqx
.migrations<CreateUsersTable,
CreateRolesTable,