metal-orm 1.0.100 → 1.0.102

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "metal-orm",
3
- "version": "1.0.100",
3
+ "version": "1.0.102",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "engines": {
@@ -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';