@mikro-orm/core 7.1.2-dev.10 → 7.1.2-dev.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/core",
3
- "version": "7.1.2-dev.10",
3
+ "version": "7.1.2-dev.12",
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
  "keywords": [
6
6
  "data-mapper",
@@ -284,6 +284,8 @@ export declare abstract class Platform {
284
284
  isNumericColumn(mappedType: Type<unknown>): boolean;
285
285
  /** Whether the platform supports unsigned integer columns. */
286
286
  supportsUnsigned(): boolean;
287
+ /** Whether the platform persists table/column comments (so they round-trip through introspection). */
288
+ supportsComments(): boolean;
287
289
  /**
288
290
  * Maximum length of identifiers (table, column, index, constraint, …) the platform supports.
289
291
  * Names produced by {@link getIndexName} above this limit are hash-truncated. Defaults to
@@ -642,6 +642,10 @@ export class Platform {
642
642
  supportsUnsigned() {
643
643
  return false;
644
644
  }
645
+ /** Whether the platform persists table/column comments (so they round-trip through introspection). */
646
+ supportsComments() {
647
+ return true;
648
+ }
645
649
  /**
646
650
  * Maximum length of identifiers (table, column, index, constraint, …) the platform supports.
647
651
  * Names produced by {@link getIndexName} above this limit are hash-truncated. Defaults to
package/utils/Utils.js CHANGED
@@ -141,7 +141,7 @@ export function parseJsonSafe(value) {
141
141
  /** Collection of general-purpose utility methods used throughout the ORM. */
142
142
  export class Utils {
143
143
  static PK_SEPARATOR = '~~~';
144
- static #ORM_VERSION = '7.1.2-dev.10';
144
+ static #ORM_VERSION = '7.1.2-dev.12';
145
145
  /**
146
146
  * Checks if the argument is instance of `Object`. Returns false for arrays.
147
147
  */
@@ -86,7 +86,10 @@ export function getOnConflictReturningFields(meta, data, uniqueFields, options)
86
86
  if (p.autoincrement) {
87
87
  return true;
88
88
  }
89
- return Array.isArray(uniqueFields) && !uniqueFields.includes(p.name);
89
+ // for a raw `onConflictFields` fragment we can't introspect which columns form the conflict
90
+ // target, so we keep every comparable prop (returning the unique key columns is harmless) –
91
+ // otherwise the non-merged columns would never be reloaded and the entity would diverge from db
92
+ return !Array.isArray(uniqueFields) || !uniqueFields.includes(p.name);
90
93
  })
91
94
  .map(p => p.name);
92
95
  if (meta.versionProperty) {