diff --git a/drogon_ctl/create_model.cc b/drogon_ctl/create_model.cc index 0fb94d2f..c5ca0493 100644 --- a/drogon_ctl/create_model.cc +++ b/drogon_ctl/create_model.cc @@ -16,9 +16,6 @@ #include #include -#if USE_POSTGRESQL -#include -#endif #include #include #include @@ -33,7 +30,6 @@ #include using namespace drogon_ctl; -using namespace drogon::orm; std::string nameTransform(const std::string &origName, bool isType) { @@ -313,6 +309,7 @@ void create_model::createModel(const std::string &path) void create_model::handleCommand(std::vector ¶meters) { +#if USE_POSTGRESQL std::cout << "Create model" << std::endl; if (parameters.size() == 0) { @@ -322,4 +319,8 @@ void create_model::handleCommand(std::vector ¶meters) { createModel(path); } +#else + std::cout << "No database can be found in your system, please install one first!" << std::endl; + exit(1); +#endif } diff --git a/drogon_ctl/create_model.h b/drogon_ctl/create_model.h index 0d761870..dcfdf731 100644 --- a/drogon_ctl/create_model.h +++ b/drogon_ctl/create_model.h @@ -17,13 +17,14 @@ #include #if USE_POSTGRESQL #include +using namespace drogon::orm; #endif #include #include "CommandHandler.h" #include using namespace drogon; -using namespace drogon::orm; + namespace drogon_ctl {