From 3d84409a58ce9693eddb8876f529ef402e86fd82 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 13 Mar 2023 18:18:04 +0000 Subject: [PATCH] Making sure created flag gets carried across for external tables. --- packages/server/src/integrations/utils.ts | 5 ++++- packages/types/src/documents/app/table.ts | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/server/src/integrations/utils.ts b/packages/server/src/integrations/utils.ts index 67e802e273..ba80bb9899 100644 --- a/packages/server/src/integrations/utils.ts +++ b/packages/server/src/integrations/utils.ts @@ -257,9 +257,12 @@ function copyExistingPropsOver( tableIds: [string] ) { if (entities && entities[tableName]) { - if (entities[tableName].primaryDisplay) { + if (entities[tableName]?.primaryDisplay) { table.primaryDisplay = entities[tableName].primaryDisplay } + if (entities[tableName]?.created) { + table.created = entities[tableName]?.created + } const existingTableSchema = entities[tableName].schema for (let key in existingTableSchema) { if (!existingTableSchema.hasOwnProperty(key)) { diff --git a/packages/types/src/documents/app/table.ts b/packages/types/src/documents/app/table.ts index 01d2486dcb..929409d0e9 100644 --- a/packages/types/src/documents/app/table.ts +++ b/packages/types/src/documents/app/table.ts @@ -76,6 +76,7 @@ export interface Table extends Document { sql?: boolean indexes?: { [key: string]: any } rows?: { [key: string]: any } + created?: boolean } export interface TableRequest extends Table {