From b7a547613541a128d9f3abb60dedf48617610d0a Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 6 Jul 2021 13:10:02 +0100 Subject: [PATCH] Don't allow foreign key to be the primary key of a row (this would break things). --- .../CreateEditRelationship/CreateEditRelationship.svelte | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/CreateEditRelationship/CreateEditRelationship.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/CreateEditRelationship/CreateEditRelationship.svelte index c69d898172..849e1f0716 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/CreateEditRelationship/CreateEditRelationship.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/CreateEditRelationship/CreateEditRelationship.svelte @@ -62,6 +62,7 @@ if ($touched.toCol && !toRelate.name) { errors.toCol = colNotSet } + // currently don't support relationships back onto the table itself, needs to relate out const tableError = "From/to/through tables must be different" if (fromTable && (fromTable === toTable || fromTable === throughTable)) { errors.from = tableError @@ -241,10 +242,10 @@ bind:error={errors.through} bind:value={fromRelationship.through} /> - {:else if toTable} + {:else if fromRelationship?.relationshipType && toTable}