@mikro-orm/entity-generator 6.3.14-dev.37 → 6.3.14-dev.38
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/EntityGenerator.js +6 -3
- package/package.json +3 -3
package/EntityGenerator.js
CHANGED
|
@@ -99,7 +99,7 @@ class EntityGenerator {
|
|
|
99
99
|
}
|
|
100
100
|
this.detectManyToManyRelations(metadata, options.onlyPurePivotTables, options.readOnlyPivotTables, options.outputPurePivotTables);
|
|
101
101
|
if (options.bidirectionalRelations) {
|
|
102
|
-
this.generateBidirectionalRelations(metadata);
|
|
102
|
+
this.generateBidirectionalRelations(metadata, options.outputPurePivotTables);
|
|
103
103
|
}
|
|
104
104
|
if (options.identifiedReferences) {
|
|
105
105
|
this.generateIdentifiedReferences(metadata);
|
|
@@ -206,8 +206,11 @@ class EntityGenerator {
|
|
|
206
206
|
owner.addProperty(ownerProp);
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
generateBidirectionalRelations(metadata) {
|
|
210
|
-
|
|
209
|
+
generateBidirectionalRelations(metadata, includeUnreferencedPurePivotTables) {
|
|
210
|
+
const filteredMetadata = includeUnreferencedPurePivotTables
|
|
211
|
+
? metadata
|
|
212
|
+
: metadata.filter(m => !m.pivotTable || this.referencedEntities.has(m));
|
|
213
|
+
for (const meta of filteredMetadata) {
|
|
211
214
|
for (const prop of meta.relations) {
|
|
212
215
|
const targetMeta = metadata.find(m => m.className === prop.type);
|
|
213
216
|
const newProp = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/entity-generator",
|
|
3
|
-
"version": "6.3.14-dev.
|
|
3
|
+
"version": "6.3.14-dev.38",
|
|
4
4
|
"description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -58,13 +58,13 @@
|
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@mikro-orm/knex": "6.3.14-dev.
|
|
61
|
+
"@mikro-orm/knex": "6.3.14-dev.38",
|
|
62
62
|
"fs-extra": "11.2.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@mikro-orm/core": "^6.3.13"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"@mikro-orm/core": "6.3.14-dev.
|
|
68
|
+
"@mikro-orm/core": "6.3.14-dev.38"
|
|
69
69
|
}
|
|
70
70
|
}
|