Skip to content

Commit 14dce51

Browse files
committed
Fix pull relations m-m bug
1 parent 9e70ee7 commit 14dce51

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drizzle-kit/src/cli/commands/introspect.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -834,9 +834,9 @@ export const relationsToTypeScript = (
834834
tableRelations[toTable2].push({
835835
name: plural(toTable1),
836836
type: 'many-through',
837-
tableFrom: tableFrom2,
837+
tableFrom: toTable2,
838838
columnsFrom: fk2.columnsFrom,
839-
tableTo: toTable2,
839+
tableTo: toTable1,
840840
columnsTo: columnsTo2,
841841
tableThrough,
842842
columnsThroughFrom,
@@ -923,7 +923,7 @@ export const relationsToTypeScript = (
923923
}
924924
return {
925925
...relation,
926-
name,
926+
name: withCasing(name, casing),
927927
relationName,
928928
};
929929
},

0 commit comments

Comments
 (0)