From 1a23741727b1caed2c1d59fd27c04bcb78f9e84e Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 4 Jan 2024 13:19:27 +0000 Subject: [PATCH] fix: add missing validation --- packages/nocodb/src/db/BaseModelSqlv2.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/nocodb/src/db/BaseModelSqlv2.ts b/packages/nocodb/src/db/BaseModelSqlv2.ts index 5eb9113c47..cd98f1bd97 100644 --- a/packages/nocodb/src/db/BaseModelSqlv2.ts +++ b/packages/nocodb/src/db/BaseModelSqlv2.ts @@ -2962,6 +2962,12 @@ class BaseModelSqlv2 { for (let i = 0; i < this.model.columns.length; ++i) { const col = this.model.columns[i]; + if (col.title in d && isCreatedTimeOrUpdatedTimeCol(col)) { + NcError.badRequest( + `Column "${col.title}" is auto generated and cannot be updated`, + ); + } + // populate pk columns if (col.pk) { if (col.meta?.ag && !d[col.title]) {