@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.mjs CHANGED
@@ -2315,7 +2315,7 @@ const createMorphToOne = (attributeName, attribute) => {
2315
2315
  });
2316
2316
  };
2317
2317
  const createMorphToMany = (attributeName, attribute, meta, metadata) => {
2318
- if ("joinTable" in attribute && attribute.joinTable) {
2318
+ if ("joinTable" in attribute && attribute.joinTable && !attribute.joinTable.__internal__) {
2319
2319
  return;
2320
2320
  }
2321
2321
  const joinTableName = identifiers.getMorphTableName(meta.tableName, attributeName);
@@ -2385,6 +2385,7 @@ const createMorphToMany = (attributeName, attribute, meta, metadata) => {
2385
2385
  columnToAttribute: {}
2386
2386
  });
2387
2387
  const joinTable = {
2388
+ __internal__: true,
2388
2389
  name: joinTableName,
2389
2390
  joinColumn: {
2390
2391
  name: joinColumnName,
@@ -2454,7 +2455,7 @@ const createJoinTable = (metadata, { attributeName, attribute, meta }) => {
2454
2455
  if (!targetMeta) {
2455
2456
  throw new Error(`Unknown target ${attribute.target}`);
2456
2457
  }
2457
- if ("joinTable" in attribute && attribute.joinTable) {
2458
+ if ("joinTable" in attribute && attribute.joinTable && !attribute.joinTable.__internal__) {
2458
2459
  return;
2459
2460
  }
2460
2461
  const joinTableName = identifiers.getJoinTableName(
@@ -2538,6 +2539,7 @@ const createJoinTable = (metadata, { attributeName, attribute, meta }) => {
2538
2539
  columnToAttribute: {}
2539
2540
  };
2540
2541
  const joinTable = {
2542
+ __internal__: true,
2541
2543
  name: joinTableName,
2542
2544
  joinColumn: {
2543
2545
  name: joinColumnName,
@@ -2597,6 +2599,7 @@ const createJoinTable = (metadata, { attributeName, attribute, meta }) => {
2597
2599
  );
2598
2600
  }
2599
2601
  inverseAttribute.joinTable = {
2602
+ __internal__: true,
2600
2603
  name: joinTableName,
2601
2604
  joinColumn: joinTable.inverseJoinColumn,
2602
2605
  inverseJoinColumn: joinTable.joinColumn,