Skip to content

Commit

Permalink
fix: Resolve many to many issue since adding in double quotes to names
Browse files Browse the repository at this point in the history
  • Loading branch information
keonik committed Mar 28, 2023
1 parent 67622b1 commit 69164bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ERD.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions src/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,11 @@ ${
}

const relationshipName = `${isEnum ? 'enum:' : ''}${field.name}`;
const thisSide = model.dbName || model.name;
const otherSide = field.type;
const thisSide = `"${model.dbName || model.name}"`;
const otherSide = `"${
modellikes.find((ml) => ml.name === field.type)?.dbName ||
field.type
}"`;
// normal relations
if (
(field.relationFromFields &&
Expand Down

0 comments on commit 69164bd

Please sign in to comment.