From aaaba8aa973607e76d9edbbdba48c3dea4689f0f Mon Sep 17 00:00:00 2001 From: An Tao Date: Tue, 10 Sep 2019 15:14:57 +0800 Subject: [PATCH] Fix a bug of models (#239) --- drogon_ctl/templates/model_cc.csp | 7 ++++++- lib/src/HttpAppFrameworkImpl.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drogon_ctl/templates/model_cc.csp b/drogon_ctl/templates/model_cc.csp index 365ef374..a3902aa2 100644 --- a/drogon_ctl/templates/model_cc.csp +++ b/drogon_ctl/templates/model_cc.csp @@ -52,7 +52,12 @@ const bool [[className]]::hasPrimaryKey = true; <%c++ }else{%> const bool [[className]]::hasPrimaryKey = false; <%c++}%> -const std::string [[className]]::tableName = "[[tableName]]"; +const std::string [[className]]::tableName = "<%c++ +if(!schema.empty()) +{ + $$<[[tableName]]"; const std::vector [[className]]::_metaData={ <%c++for(size_t i=0;i &advice) override { - getLoop()->runInLoop(advice); + getLoop()->queueInLoop(advice); return *this; }