diff --git a/drogon_ctl/create_model.cc b/drogon_ctl/create_model.cc index ddeebca7..e49a70a8 100644 --- a/drogon_ctl/create_model.cc +++ b/drogon_ctl/create_model.cc @@ -64,7 +64,8 @@ static std::map> getRelationships( Relationship r(relationship); ret[r.originalTableName()].push_back(r); if (r.enableReverse() && - r.originalTableName() != r.targetTableName()) + (r.originalTableName() != r.targetTableName() || + r.originalTableAlias() != r.targetTableAlias())) { auto reverse = r.reverse(); ret[reverse.originalTableName()].push_back(reverse);