Skip to content

Releases: mikro-orm/mikro-orm

v5.2.0

10 Jun 08:03

Choose a tag to compare

5.2.0 (2022-06-10)

Bug Fixes

  • core: allow changing PK via UoW (32ab215), closes #3184
  • core: ensure correct cached value in loadCount (4471bb8)
  • query-builder: fix calling qb.count('id', true).getCount() (a97324a), closes #3182
  • query-builder: fix processing of custom types in explicitly aliased queries (db137a6), closes #3172
  • schema: do not consider autoincrement columns as primary automatically (088afdb), closes #3187
  • ts-morph: use module: 'node16' for reflection (024d9d9), closes #3168
  • typing detection with typescript 4.7 node16 (#3163) (08322fa)

Features

  • core: automatically discover target embeddables and relationships (#3190) (8624dc5)
  • entity-generator: allow generating bidirectional relations (8b93400), closes #3181
  • entity-generator: allow generating identified references (1fbf5ac)
  • knex: allow reusing existing knex client via driverOptions (c169eda), closes #3167
  • schema: add logging to schema comparator (f96eaaf)

v5.1.5

29 May 15:44

Choose a tag to compare

5.1.5 (2022-05-29)

Bug Fixes

  • cli: disable TS mode when we fail to register ts-node (457d9d3), closes #3152
  • core: assign new embeddable entity only when it is null or undefined (#3135) (4f870fb)
  • core: support TypeScript 4.7 (06b6e4e)
  • query-builder: fix aliasing of relations with composite PK (095e241), closes #3053

Performance Improvements

  • query-builder: use distinct counts only when joining to-many relations (eebe34d), closes #3044

v5.1.4

19 May 21:49

Choose a tag to compare

5.1.4 (2022-05-19)

Bug Fixes

  • core: allow asterisk in FindOptions.fields on TS level (43e1d0b), closes #3127
  • core: fix aliasing of formula properties in complex conditions (#3130) (071846e)
  • core: improve type of em.getContext() (158f077), closes #3120
  • core: improve validation of wrong entity references (#3085) (f5de135)
  • core: wrap relations in Reference wrapper when assigning entity instance (97f1f59), closes #3092
  • mongo: support queries with mongo specific operators on embeddables (2fb9002)
  • postgres: do not try to create schema for migrations when it exists (d6af811), closes #3106
  • postgres: fix resolving knex when other version is explicitly installed (41f5665), closes #3129
  • postgres: ignore schemas prefixed with crdb_ too (049fea3), closes #3021
  • schema: always ignore PostGIS schemas when diffing (#3096) (626e3db)
  • ts-morph: do not mark properties as enums automatically based on type (c3923df), closes #3099

Features

  • core: add strict option to em.findOneOrFail() (#3088) (d38242a)
  • postgres: allow ignoring specified schemas (3f1d2da)

v5.1.3

27 Apr 08:00

Choose a tag to compare

5.1.3 (2022-04-27)

Bug Fixes

  • core: allow replacing target entity in relations with assign (90ec83f), closes #3026
  • core: do not inline query for JSON properties that match PK names (e6005d8), closes #3054
  • core: fix serialization when using partial loading for nested relations (00be9f1), closes #3011
  • core: hydrate nullable embedded properties as null (e8490f6), closes #3063
  • core: respect mapToPk when expanding properties (#3031) (757801e)
  • core: try to fix FK order automatically for custom pivot entities (cc9e427), closes #3040
  • mongo: fix ensuring indexes with polymorphic embeddables (aa5e4d2), closes #3013
  • postgres: allow using special characters in string arrays (366da5f), closes #3037
  • postgres: ensure schema exists before creating migrations table (f211813), closes #3039
  • schema: fix diffing of indexes with too long inferred name (01ba9ed), closes #2932
  • schema: remove FKs first when trying to dropSchema without disabled FKs (b1b5f55), closes #3004
  • seeder: explicitly flush forks when calling Seeder.call() (c8ece7c), closes #2998
  • seeder: fix type of Factory methods (#3064) (06e88e7)
  • sqlite: fix reflection of tables with FKs (389bc0d), closes #2959
  • sqlite: upgrade knex to v2 + switch back to sqlite3 (f3e4b9d), closes #3046

Features

  • core: validate decorator parameters are used properly (cb3e1dd), closes #3040
  • seeder: created shared context when calling other seeders (6fa04ae), closes #3022

Performance Improvements

  • core: do not use contextual EM where we know we are in a fork already (ba16532)

v5.1.2

10 Apr 15:07

Choose a tag to compare

5.1.2 (2022-04-10)

Bug Fixes

  • core: allow converting custom types via em.nativeInsert() (#2979) (8d76852)
  • core: do not clean up UoW before each "flush step" (3ae732d), closes #2934
  • core: do not quote knex.raw() instances returned from custom types (8a4c836), closes #1841
  • core: fix eager loading of nested embeddable m:1 properties (4867db9), closes #2975
  • core: fix eager loading when multiple relations target same entity (21922ce), closes #2990
  • core: fix mapping of inserted PKs with custom field names from batch insert (080d8e0), closes #2977
  • core: never reassign the same entity via em.assign() (cdfbabd), closes #2974
  • core: propagate entity removal in em.transactional() to upper context (6e5166b), closes #2973
  • core: respect connectionType in populate queries (fe40a9f), closes #2994
  • core: support PopulateHint.INFER with pagination and joined strategy (56f8737), closes #2985
  • core: use correct path for relations inside embeddables with populate: true (4735dba), closes #2948
  • postgres: do not ignore custom PK constraint names (#2931) (24bf10e)
  • postgres: drop enum constraints only when the column was an enum (76fef39)
  • postgres: ensure correct column order in compound index/uniques (321be79), closes #2932
  • postgres: fix pagination with order by bool column (d5476cd), closes #2910
  • postgres: fix schema diffing on enums with case-sensitive names (050875b), closes #2938 #2932
  • schema: do not create FK index for 1:1 properties (they are unique already) (473795c), closes #2942

Features

  • mariadb: implement check constraint support + fix json column diffing (b513b16), closes #2151
  • schema: support mysql 8 (#2961) (acc960e)

v5.1.1

20 Mar 10:36

Choose a tag to compare

5.1.1 (2022-03-20)

Bug Fixes

  • core: fix custom pivot table entities for unidirectional relations (01bdbf6)
  • knex: order by with a formula field should not include as for sub-queries (#2929) (74751fb)
  • postgres: allow explicit schema name in prop.pivotTable (1860ff5), closes #2919
  • postgres: fix pagination with order by UUID PK (042626c), closes #2910
  • postgres: respect known schema when loading wild card entity relations (61d1e85), closes #2909
  • schema: respect disableForeignKeys in schema generator (f1b8e46), closes #2912

Features

  • core: validate em.begin was called when using em.commit/rollback (67fa076), closes #2918

v5.1.0

13 Mar 18:47

Choose a tag to compare

5.1.0 (2022-03-13)

Bug Fixes

  • core: do not alias JSON conditions on update/delete queries (5c0674e), closes #2839
  • core: ensure all entities from inner context are merged to the upper one (7b3a6b4), closes #2882
  • core: fix object key utilities for null prototype objects (#2847) (b2cf01e), closes #2846
  • core: fix ordering by complex composite PKs (dde11d3), closes #2886
  • core: fix strict type for orderBy when entity has length property (ef45871), closes #2829
  • core: type global entityRepository option weakly (3faf8bc)
  • knex: order by with a formula field should not include as (#2848) (09e8bfa)
  • knex: fully qualify sub-query order-by fields (#2835) (f74dc73)
  • mysql: mark FK columns as unsigned for mixed composite PKs (67806cb), closes #2844
  • postgres: respect schema name in migration storage (fbf9bfa), closes #2828

Features

  • core: allow better control over connection type when using read-replicas (#2896) (e40ae2d)
  • core: allow specifying custom pivot table entity (#2901) (8237d16)
  • core: allow using hooks for interface entities (#2895) (aee99b1)
  • core: enable QueryFlag.PAGINATE automatically for em.find() (ccb4223), closes #2867
  • core: map check constraint failures to specific error type (ebcbdff), closes #2836

v5.0.5

27 Feb 12:08

Choose a tag to compare

5.0.5 (2022-02-27)

Bug Fixes

  • core: fix auto-joining multiple 1:1 properties (0566e74), closes #2821
  • core: respect orphanRemoval in 1:1 relations (#2816) (55ff07b)
  • knex: respect explicit transaction in em.count() (#2818) (2d26a63)
  • migrations: ensure executedAt is a Date when listing executed migrations (c8753ee), closes #2817
  • query-builder: use paginate flag automatically based on to-many joins (db9963f), closes #2823

v5.0.4

22 Feb 20:25

Choose a tag to compare

5.0.4 (2022-02-22)

Bug Fixes

  • core: always create new entities as initialized (bbb30c5)
  • core: fix mapping default values of relation properties (bc57ed0)
  • core: fix propagation of FK as PK with not flushed entity (25be857), closes #2810
  • core: fix unsetting identity of orphans (1:1 with orphan removal) (91e7315), closes #2806
  • core: respect schema from config when adding new entities to context (7a6b6e2)
  • core: respect load strategy specified in property definition (1a6b4b2), closes #2803
  • entity-generator: fix property names for columns with dashes (#2813) (c920d5f)
  • schema: escape table/column comments (fff1581), closes #2805

v5.0.3

20 Feb 15:30

Choose a tag to compare

5.0.3 (2022-02-20)

Bug Fixes

  • core: do not trigger global context validation from repositories (f651865), closes #2778
  • core: fix processing of onUpdate properties (9cf454e), closes #2781
  • core: fix processing of multiple onUpdate properties on one entity (4f0e4cc), closes #2784
  • core: hydrate not-null embeddable prop even with all null values (09aee05), closes #2774
  • core: register entity to identity map as early as possible (d8f3613), closes #2777
  • core: respect onDelete: cascade when propagating removal (f1e8578), closes #2703
  • core: revert to require() when getting ORM version to fix webpack support (6cfb526), closes #2799
  • migrations: generate snapshot too when using --initial (4857be7), closes #2800
  • postgres: consider int8 as numeric when inferring autoincrement value (64bc99d), closes #2791
  • sqlite: respect autoincrement: false in schema diffing (b39b6ad), closes #2800
  • typing: fix populate hints on collections where both type args are provided (e39ef5b), closes #2771

Features

  • add better-sqlite driver (#2792) (1b39d66)
  • core: add connect config option (8aaad33)
  • core: add SchemaGenerator.clearDatabase() (ecad9c6), closes #2220
  • core: add populate option to Reference.load and Collection.loadItems (1527c1a), closes #2796