Browse Source

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

pull/7304/head
Pranav C 11 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'), (c.uidt === UITypes.CreateTime ? 'created_at' : 'updated_at'),
); );
if(!dbColumn){ if (!dbColumn) {
// create column in db // create column in db
} }
await Column.insert({ await Column.insert({
@ -2148,6 +2148,13 @@ export class ColumnsService {
} }
/* falls through to default */ /* 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: { default: {
const tableUpdateBody = { const tableUpdateBody = {
...table, ...table,

Loading…
Cancel
Save