Fix the 'many to many' relationship (#369)

This commit is contained in:
An Tao 2020-03-01 16:48:18 +08:00 committed by GitHub
parent 810896c94c
commit 8d17cc567e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -64,7 +64,8 @@ static std::map<std::string, std::vector<Relationship>> getRelationships(
Relationship r(relationship); Relationship r(relationship);
ret[r.originalTableName()].push_back(r); ret[r.originalTableName()].push_back(r);
if (r.enableReverse() && if (r.enableReverse() &&
r.originalTableName() != r.targetTableName()) (r.originalTableName() != r.targetTableName() ||
r.originalTableAlias() != r.targetTableAlias()))
{ {
auto reverse = r.reverse(); auto reverse = r.reverse();
ret[reverse.originalTableName()].push_back(reverse); ret[reverse.originalTableName()].push_back(reverse);