diff --git a/db/create.h b/db/create.h index 7d9d21c..6e901f9 100644 --- a/db/create.h +++ b/db/create.h @@ -1,12 +1,17 @@ #pragma once #include +#include #include namespace db { - sql::Database init(std::string name) { - sql::Database db(name, SQLite::OPEN_READWRITE|SQLite::OPEN_CREATE); - DEBUG << "SQLite database file '" << db.getFilename().c_str() << "' opened successfully\n"; + sql::Database* init(std::string name) { + sql::Database* db = new sql::Database(name, SQLite::OPEN_READWRITE|SQLite::OPEN_CREATE); + DEBUG << "SQLite database file '" << db->getFilename().c_str() << "' opened successfully\n"; + + + Schema* schema = new Schema(db); + schema->run_migrations(); return db; } }