From 488b542ac1a74cfaf1043fc6916a8550cc1ef816 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 14 Feb 2023 14:38:55 +0000 Subject: [PATCH] Fix for #9654 - the error checking was looking at the through fields flipped, which caused many to many relationships to throw an error. Also I've updated the dev compose file on master so that switching between develop and master is smoother. --- hosting/docker-compose.dev.yaml | 19 +++-------- .../Datasources/CreateEditRelationship.svelte | 18 +++-------- .../integrations/postgres/emp-territory.sql | 32 +++++++++++++++++++ 3 files changed, 41 insertions(+), 28 deletions(-) create mode 100644 packages/server/scripts/integrations/postgres/emp-territory.sql diff --git a/hosting/docker-compose.dev.yaml b/hosting/docker-compose.dev.yaml index 7906a389fa..7d8198db73 100644 --- a/hosting/docker-compose.dev.yaml +++ b/hosting/docker-compose.dev.yaml @@ -42,25 +42,16 @@ services: couchdb-service: # platform: linux/amd64 - container_name: budi-couchdb-dev + container_name: budi-couchdb3-dev restart: on-failure - image: ibmcom/couchdb3 + image: budibase/couchdb environment: - COUCHDB_PASSWORD=${COUCH_DB_PASSWORD} - COUCHDB_USER=${COUCH_DB_USER} ports: - "${COUCH_DB_PORT}:5984" volumes: - - couchdb3_data:/opt/couchdb/data - - couch-init: - container_name: budi-couchdb-init-dev - image: curlimages/curl - environment: - PUT_CALL: "curl -u ${COUCH_DB_USER}:${COUCH_DB_PASSWORD} -X PUT couchdb-service:5984" - depends_on: - - couchdb-service - command: ["sh","-c","sleep 10 && $${PUT_CALL}/_users && $${PUT_CALL}/_replicator; fg;"] + - couchdb_data:/data redis-service: container_name: budi-redis-dev @@ -73,9 +64,9 @@ services: - redis_data:/data volumes: - couchdb3_data: + couchdb_data: driver: local minio_data: driver: local redis_data: - driver: local + driver: local \ No newline at end of file diff --git a/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte b/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte index 4a3c4f6c60..1413cd157e 100644 --- a/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte +++ b/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte @@ -152,7 +152,7 @@ fromTable, throughTable, fromTable.primary[0], - throughFromKey + throughToKey ), throughToKey: errorChecker.manyForeignKeySet(throughToKey) || @@ -160,7 +160,7 @@ toTable, throughTable, toTable.primary[0], - throughToKey + throughFromKey ), fromForeign: errorChecker.foreignKeySet(fromForeign) || @@ -391,24 +391,14 @@ options={Object.keys(getTable(throughId)?.schema)} bind:value={throughToKey} bind:error={errors.throughToKey} - on:change={e => - changed(() => { - if (throughFromKey === e.detail) { - throughFromKey = null - } - })} + on:change={changed} />