Browse Source

feat: when deleting `CreateTime` or `LastModifiedTime`, keep the column and just delete the meta entry

pull/7304/head
Pranav C 12 months ago
parent
commit
750756fdef
  1. 11
      packages/nocodb/src/services/columns.service.ts

11
packages/nocodb/src/services/columns.service.ts

@ -1701,8 +1701,8 @@ export class ColumnsService {
(c.uidt === UITypes.CreateTime ? 'created_at' : 'updated_at'),
);
if(!dbColumn){
// create column in db
if (!dbColumn) {
// create column in db
}
await Column.insert({
@ -2148,6 +2148,13 @@ export class ColumnsService {
}
/* falls through to default */
}
// on delete create time or last modified time, keep the column in table and delete the column from meta
case UITypes.CreateTime:
case UITypes.LastModifiedTime: {
await Column.delete(param.columnId, ncMeta);
}
break;
default: {
const tableUpdateBody = {
...table,

Loading…
Cancel
Save