metal-orm 1.0.100 → 1.0.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -104,6 +104,10 @@ export const mapRelations = (tables, naming) => {
|
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
// Skip generating HasMany/HasOne relations TO pivot tables
|
|
108
|
+
// (pivot data is accessible via _pivot on BelongsToMany)
|
|
109
|
+
if (pivotTables.has(table.name)) continue;
|
|
110
|
+
|
|
107
111
|
const uniqueCols = uniqueSingleColumns.get(table.name);
|
|
108
112
|
const isHasOne = Boolean(uniqueCols?.has(fk.name));
|
|
109
113
|
const relationKind = isHasOne ? 'hasOne' : 'hasMany';
|