From 71f96f9601bba39cc50d139b92c65d8079ea489e Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Sat, 3 Jul 2021 10:26:37 +0100 Subject: [PATCH] Fixing little UI bugs. --- .../datasource/[selectedDatasource]/index.svelte | 12 +++++++++--- packages/server/src/integrations/postgres.ts | 6 +++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/index.svelte index 9905d80684..85f300119c 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/index.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/index.svelte @@ -177,9 +177,11 @@ Update display columns {/if} - +
+ +
@@ -319,4 +321,8 @@ grid-gap: var(--spacing-l); grid-template-columns: 1fr 1fr; } + + .table-buttons div { + grid-column-end: -1; + } diff --git a/packages/server/src/integrations/postgres.ts b/packages/server/src/integrations/postgres.ts index f4f4e20582..935bfbeeea 100644 --- a/packages/server/src/integrations/postgres.ts +++ b/packages/server/src/integrations/postgres.ts @@ -134,6 +134,7 @@ module PostgresModule { /** * Fetches the tables from the postgres table and assigns them to the datasource. * @param {*} datasourceId - datasourceId to fetch + * @param entities - the tables that are to be built */ async buildSchema(datasourceId: string, entities: Record) { let tableKeys: { [key: string]: string[] } = {} @@ -169,9 +170,12 @@ module PostgresModule { } // add the existing relationships from the entities if they exist, to prevent them from being overridden - if (entities) { + if (entities && entities[tableName]) { const existingTableSchema = entities[tableName].schema for (let key in existingTableSchema) { + if (!existingTableSchema.hasOwnProperty(key)) { + continue + } if (existingTableSchema[key].type === "link") { tables[tableName].schema[key] = existingTableSchema[key] }