@mikro-orm/core 7.0.0-dev.146 → 7.0.0-dev.147
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/metadata/MetadataDiscovery.js +6 -5
- package/package.json +1 -1
- package/utils/Utils.js +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EntityMetadata, } from '../typings.js';
|
|
2
|
-
import { Utils } from '../utils/Utils.js';
|
|
2
|
+
import { compareArrays, Utils } from '../utils/Utils.js';
|
|
3
3
|
import { MetadataValidator } from './MetadataValidator.js';
|
|
4
4
|
import { MetadataProvider } from './MetadataProvider.js';
|
|
5
5
|
import { MetadataStorage } from './MetadataStorage.js';
|
|
@@ -932,7 +932,8 @@ export class MetadataDiscovery {
|
|
|
932
932
|
let i = 1;
|
|
933
933
|
Object.values(meta.properties).forEach(prop => {
|
|
934
934
|
const newProp = { ...prop };
|
|
935
|
-
|
|
935
|
+
const rootProp = meta.root.properties[prop.name];
|
|
936
|
+
if (rootProp && (rootProp.type !== prop.type || (rootProp.fieldNames && prop.fieldNames && !compareArrays(rootProp.fieldNames, prop.fieldNames)))) {
|
|
936
937
|
const name = newProp.name;
|
|
937
938
|
this.initFieldName(newProp, newProp.object);
|
|
938
939
|
newProp.name = name + '_' + (i++);
|
|
@@ -943,11 +944,11 @@ export class MetadataDiscovery {
|
|
|
943
944
|
newProp.inherited = true;
|
|
944
945
|
return;
|
|
945
946
|
}
|
|
946
|
-
if (prop.enum && prop.items &&
|
|
947
|
-
newProp.items = Utils.unique([...
|
|
947
|
+
if (prop.enum && prop.items && rootProp?.items) {
|
|
948
|
+
newProp.items = Utils.unique([...rootProp.items, ...prop.items]);
|
|
948
949
|
}
|
|
949
950
|
newProp.nullable = true;
|
|
950
|
-
newProp.inherited = !
|
|
951
|
+
newProp.inherited = !rootProp;
|
|
951
952
|
meta.root.addProperty(newProp);
|
|
952
953
|
});
|
|
953
954
|
meta.tableName = meta.root.tableName;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.0.0-dev.
|
|
4
|
+
"version": "7.0.0-dev.147",
|
|
5
5
|
"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.",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./package.json": "./package.json",
|
package/utils/Utils.js
CHANGED
|
@@ -123,7 +123,7 @@ export function parseJsonSafe(value) {
|
|
|
123
123
|
}
|
|
124
124
|
export class Utils {
|
|
125
125
|
static PK_SEPARATOR = '~~~';
|
|
126
|
-
static #ORM_VERSION = '7.0.0-dev.
|
|
126
|
+
static #ORM_VERSION = '7.0.0-dev.147';
|
|
127
127
|
/**
|
|
128
128
|
* Checks if the argument is instance of `Object`. Returns false for arrays.
|
|
129
129
|
*/
|