@mikro-orm/core 6.5.9-dev.4 → 6.5.9-dev.6

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.
@@ -414,14 +414,14 @@ declare const propertyBuilders: {
414
414
  };
415
415
  export declare function defineEntity<Properties extends Record<string, any>, const PK extends (keyof Properties)[] | undefined = undefined, Base = never>(meta: Omit<Partial<EntityMetadata<InferEntityFromProperties<Properties, PK>>>, 'properties' | 'extends' | 'primaryKeys' | 'hooks'> & {
416
416
  name: string;
417
- extends?: string | EntitySchema<Base>;
417
+ extends?: EntityName<Base>;
418
418
  properties: Properties | ((properties: typeof propertyBuilders) => Properties);
419
419
  primaryKeys?: PK & InferPrimaryKey<Properties>[];
420
420
  hooks?: DefineEntityHooks<InferEntityFromProperties<Properties, PK>>;
421
421
  }): EntitySchema<InferEntityFromProperties<Properties, PK>, Base>;
422
- export declare function defineEntity<Entity = any, Base = never>(meta: Omit<Partial<EntityMetadata<Entity>>, 'properties'> & {
422
+ export declare function defineEntity<Entity = any, Base = never>(meta: Omit<Partial<EntityMetadata<Entity>>, 'properties' | 'extends'> & {
423
423
  class: EntityClass<Entity>;
424
- extends?: string | EntitySchema<Base>;
424
+ extends?: EntityName<Base>;
425
425
  properties: Record<string, any> | ((properties: typeof propertyBuilders) => Record<string, any>);
426
426
  }): EntitySchema<Entity, Base>;
427
427
  export declare namespace defineEntity {
@@ -33,7 +33,7 @@ export type EntitySchemaMetadata<Entity, Base = never> = Omit<Partial<EntityMeta
33
33
  class: EntityClass<Entity>;
34
34
  name?: string;
35
35
  }) & {
36
- extends?: string | EntitySchema<Base>;
36
+ extends?: EntityName<Base>;
37
37
  } & {
38
38
  properties?: {
39
39
  [Key in keyof OmitBaseProps<Entity, Base> as CleanKeys<OmitBaseProps<Entity, Base>, Key>]-?: EntitySchemaProperty<ExpandProperty<NonNullable<Entity[Key]>>, Entity>;
@@ -63,7 +63,7 @@ export declare class EntitySchema<Entity = any, Base = never> {
63
63
  addIndex<Key extends string>(options: IndexOptions<Entity, Key>): void;
64
64
  addUnique<Key extends string>(options: UniqueOptions<Entity, Key>): void;
65
65
  setCustomRepository(repository: () => Constructor): void;
66
- setExtends(base: string | EntitySchema): void;
66
+ setExtends(base: EntityName<any>): void;
67
67
  setClass(proto: EntityClass<Entity>): void;
68
68
  get meta(): EntityMetadata<Entity>;
69
69
  get name(): EntityName<Entity>;
@@ -229,6 +229,9 @@ class MetadataDiscovery {
229
229
  if (parent instanceof EntitySchema_1.EntitySchema && !this.metadata.has(parent.meta.className)) {
230
230
  this.discoverReferences([parent]);
231
231
  }
232
+ if (typeof parent === 'function' && parent.name && !this.metadata.has(parent.name)) {
233
+ this.discoverReferences([parent]);
234
+ }
232
235
  if (!meta.class) {
233
236
  continue;
234
237
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/core",
3
- "version": "6.5.9-dev.4",
3
+ "version": "6.5.9-dev.6",
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",
@@ -64,7 +64,7 @@
64
64
  "esprima": "4.0.1",
65
65
  "fs-extra": "11.3.2",
66
66
  "globby": "11.1.0",
67
- "mikro-orm": "6.5.9-dev.4",
67
+ "mikro-orm": "6.5.9-dev.6",
68
68
  "reflect-metadata": "0.2.2"
69
69
  }
70
70
  }