@strapi/database 5.0.0-rc.12 → 5.0.0-rc.13

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/dist/index.js CHANGED
@@ -2347,7 +2347,7 @@ const createMorphToOne = (attributeName, attribute) => {
2347
2347
  });
2348
2348
  };
2349
2349
  const createMorphToMany = (attributeName, attribute, meta, metadata) => {
2350
- if ("joinTable" in attribute && attribute.joinTable) {
2350
+ if ("joinTable" in attribute && attribute.joinTable && !attribute.joinTable.__internal__) {
2351
2351
  return;
2352
2352
  }
2353
2353
  const joinTableName = identifiers.getMorphTableName(meta.tableName, attributeName);
@@ -2417,6 +2417,7 @@ const createMorphToMany = (attributeName, attribute, meta, metadata) => {
2417
2417
  columnToAttribute: {}
2418
2418
  });
2419
2419
  const joinTable = {
2420
+ __internal__: true,
2420
2421
  name: joinTableName,
2421
2422
  joinColumn: {
2422
2423
  name: joinColumnName,
@@ -2486,7 +2487,7 @@ const createJoinTable = (metadata, { attributeName, attribute, meta }) => {
2486
2487
  if (!targetMeta) {
2487
2488
  throw new Error(`Unknown target ${attribute.target}`);
2488
2489
  }
2489
- if ("joinTable" in attribute && attribute.joinTable) {
2490
+ if ("joinTable" in attribute && attribute.joinTable && !attribute.joinTable.__internal__) {
2490
2491
  return;
2491
2492
  }
2492
2493
  const joinTableName = identifiers.getJoinTableName(
@@ -2570,6 +2571,7 @@ const createJoinTable = (metadata, { attributeName, attribute, meta }) => {
2570
2571
  columnToAttribute: {}
2571
2572
  };
2572
2573
  const joinTable = {
2574
+ __internal__: true,
2573
2575
  name: joinTableName,
2574
2576
  joinColumn: {
2575
2577
  name: joinColumnName,
@@ -2629,6 +2631,7 @@ const createJoinTable = (metadata, { attributeName, attribute, meta }) => {
2629
2631
  );
2630
2632
  }
2631
2633
  inverseAttribute.joinTable = {
2634
+ __internal__: true,
2632
2635
  name: joinTableName,
2633
2636
  joinColumn: joinTable.inverseJoinColumn,
2634
2637
  inverseJoinColumn: joinTable.joinColumn,