@budibase/server 2.7.28 → 2.7.29

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
@@ -31583,6 +31583,12 @@ __export(utils_exports9, {
31583
31583
  getTableId: () => getTableId,
31584
31584
  validate: () => validate4
31585
31585
  });
31586
+ function isForeignKey(key, table2) {
31587
+ const relationships = Object.values(table2.schema).filter(
31588
+ (column) => column.type === "link" /* LINK */
31589
+ );
31590
+ return relationships.some((relationship) => relationship.foreignKey === key);
31591
+ }
31586
31592
  async function getDatasourceAndQuery(json2) {
31587
31593
  const datasourceId = json2.endpoint.datasourceId;
31588
31594
  const datasource2 = await sdk_default.datasources.get(datasourceId);
@@ -31621,6 +31627,9 @@ async function validate4({
31621
31627
  const column = fetchedTable.schema[fieldName];
31622
31628
  const constraints = cloneDeep9(column.constraints);
31623
31629
  const type = column.type;
31630
+ if (isForeignKey(fieldName, fetchedTable)) {
31631
+ continue;
31632
+ }
31624
31633
  if (type === "formula" /* FORMULA */ || column.autocolumn) {
31625
31634
  continue;
31626
31635
  }
@@ -31705,6 +31714,7 @@ var init_utils24 = __esm({
31705
31714
  init_constants4();
31706
31715
  init_src2();
31707
31716
  init_query4();
31717
+ init_src();
31708
31718
  init_exporters();
31709
31719
  init_sdk3();
31710
31720
  validateJs = require("validate.js");