mirror of
https://gitee.com/an-tao/drogon.git
synced 2024-11-29 18:27:43 +08:00
Fix a bug for the system without database
This commit is contained in:
parent
fc7ddd5b6c
commit
0179816c19
@ -16,9 +16,6 @@
|
||||
|
||||
#include <drogon/config.h>
|
||||
#include <drogon/utils/Utilities.h>
|
||||
#if USE_POSTGRESQL
|
||||
#include <drogon/orm/PgClient.h>
|
||||
#endif
|
||||
#include <drogon/HttpViewData.h>
|
||||
#include <drogon/DrTemplateBase.h>
|
||||
#include <json/json.h>
|
||||
@ -33,7 +30,6 @@
|
||||
#include <unistd.h>
|
||||
|
||||
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<std::string> ¶meters)
|
||||
{
|
||||
#if USE_POSTGRESQL
|
||||
std::cout << "Create model" << std::endl;
|
||||
if (parameters.size() == 0)
|
||||
{
|
||||
@ -322,4 +319,8 @@ void create_model::handleCommand(std::vector<std::string> ¶meters)
|
||||
{
|
||||
createModel(path);
|
||||
}
|
||||
#else
|
||||
std::cout << "No database can be found in your system, please install one first!" << std::endl;
|
||||
exit(1);
|
||||
#endif
|
||||
}
|
||||
|
@ -17,13 +17,14 @@
|
||||
#include <json/json.h>
|
||||
#if USE_POSTGRESQL
|
||||
#include <drogon/orm/PgClient.h>
|
||||
using namespace drogon::orm;
|
||||
#endif
|
||||
#include <drogon/DrObject.h>
|
||||
#include "CommandHandler.h"
|
||||
#include <string>
|
||||
|
||||
using namespace drogon;
|
||||
using namespace drogon::orm;
|
||||
|
||||
|
||||
namespace drogon_ctl
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user