From 168a126e2a6a2f22b7241cbb286600b5488cce9b Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 2 Feb 2022 18:15:17 +0000 Subject: [PATCH] Updating the SQL core to allow it to handle multiple relationships between the same two tables. --- .../PlusConfigForm.svelte | 44 ++++++----- .../Datasources/CreateEditRelationship.svelte | 75 ++++++++----------- .../scripts/integrations/postgres/init.sql | 17 +++-- .../api/controllers/row/ExternalRequest.ts | 13 ++++ packages/server/src/integrations/base/sql.ts | 71 ++++++++++++++---- 5 files changed, 133 insertions(+), 87 deletions(-) diff --git a/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/PlusConfigForm.svelte b/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/PlusConfigForm.svelte index 8805505c8d..45bc5ff330 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/PlusConfigForm.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/PlusConfigForm.svelte @@ -188,29 +188,27 @@ {:else} No tables found. {/if} -{#if plusTables?.length !== 0 && integration.relationships} - -
- Relationships - -
- - Tell budibase how your tables are related to get even more smart features. - - {#if relationshipInfo && relationshipInfo.length > 0} - openRelationshipModal(detail.from, detail.to)} - schema={relationshipSchema} - data={relationshipInfo} - allowEditColumns={false} - allowEditRows={false} - allowSelectRows={false} - /> - {:else} - No relationships configured. - {/if} + +
+ Relationships + +
+ + Tell budibase how your tables are related to get even more smart features. + +{#if relationshipInfo && relationshipInfo.length > 0} +
openRelationshipModal(detail.from, detail.to)} + schema={relationshipSchema} + data={relationshipInfo} + allowEditColumns={false} + allowEditRows={false} + allowSelectRows={false} + /> +{:else} + No relationships configured. {/if}