@mikro-orm/core 7.0.16-dev.10 → 7.0.16-dev.11

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.
@@ -963,9 +963,13 @@ export class MetadataDiscovery {
963
963
  meta.propertyOrder.set(prop.name, (order += 0.01));
964
964
  });
965
965
  }
966
- meta.indexes = Utils.unique([...base.indexes, ...meta.indexes]);
967
- meta.uniques = Utils.unique([...base.uniques, ...meta.uniques]);
968
- meta.checks = Utils.unique([...base.checks, ...meta.checks]);
966
+ // TPT children have their own tables that don't contain the parent's columns,
967
+ // so propagating parent indexes/uniques/checks would target missing columns.
968
+ if (meta.inheritanceType !== 'tpt' || !meta.tptParent) {
969
+ meta.indexes = Utils.unique([...base.indexes, ...meta.indexes]);
970
+ meta.uniques = Utils.unique([...base.uniques, ...meta.uniques]);
971
+ meta.checks = Utils.unique([...base.checks, ...meta.checks]);
972
+ }
969
973
  const pks = Object.values(meta.properties)
970
974
  .filter(p => p.primary)
971
975
  .map(p => p.name);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/core",
3
- "version": "7.0.16-dev.10",
3
+ "version": "7.0.16-dev.11",
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",
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.0.16-dev.10';
144
+ static #ORM_VERSION = '7.0.16-dev.11';
145
145
  /**
146
146
  * Checks if the argument is instance of `Object`. Returns false for arrays.
147
147
  */