@mikro-orm/core 7.0.0-dev.183 → 7.0.0-dev.184

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.
@@ -209,10 +209,15 @@ export class MetadataDiscovery {
209
209
  }
210
210
  tryDiscoverTargets(targets) {
211
211
  for (const target of targets) {
212
- const isDiscoverable = typeof target === 'function' || target instanceof EntitySchema;
213
- if (isDiscoverable && target.name && !this.metadata.has(target)) {
214
- this.discoverReferences([target], false);
215
- this.discoverMissingTargets();
212
+ const schema = target instanceof EntitySchema ? target : undefined;
213
+ const isDiscoverable = typeof target === 'function' || schema;
214
+ if (isDiscoverable && target.name) {
215
+ // Get the actual class for EntitySchema, or use target directly for classes
216
+ const targetClass = schema ? schema.meta.class : target;
217
+ if (!this.metadata.has(targetClass)) {
218
+ this.discoverReferences([target], false);
219
+ this.discoverMissingTargets();
220
+ }
216
221
  }
217
222
  }
218
223
  }
@@ -64,7 +64,7 @@ export class MetadataValidator {
64
64
  if (discovered.length === 0 && options.warnWhenNoEntities) {
65
65
  throw MetadataError.noEntityDiscovered();
66
66
  }
67
- const tableNames = discovered.filter(meta => !meta.abstract && meta === meta.root && (meta.tableName || meta.collection) && meta.schema !== '*');
67
+ const tableNames = discovered.filter(meta => !meta.abstract && !meta.embeddable && meta === meta.root && (meta.tableName || meta.collection) && meta.schema !== '*');
68
68
  const duplicateTableNames = Utils.findDuplicates(tableNames.map(meta => {
69
69
  const tableName = meta.tableName || meta.collection;
70
70
  return (meta.schema ? '.' + meta.schema : '') + 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.183",
4
+ "version": "7.0.0-dev.184",
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.183';
126
+ static #ORM_VERSION = '7.0.0-dev.184';
127
127
  /**
128
128
  * Checks if the argument is instance of `Object`. Returns false for arrays.
129
129
  */