Browse Source

fix(nocodb): revise mapAliasToColumn for mysql external db

pull/5642/head
Wing-Kam Wong 2 years ago
parent
commit
942993e7a9
  1. 12
      packages/nocodb/src/models/Model.ts

12
packages/nocodb/src/models/Model.ts

@ -488,10 +488,14 @@ export default class Model implements TableType {
.format('YYYY-MM-DD HH:mm:ssZ');
}
} else {
// External DB - keep it as it is
val = dayjs(val).format(
isMySQL ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD HH:mm:ssZ',
);
// External DB
if (isMySQL) {
// convert to utc
val = dayjs(val).utc().format('YYYY-MM-DD HH:mm:ss');
} else {
// keep it as it is
val = dayjs(val).format('YYYY-MM-DD HH:mm:ssZ');
}
}
}
insertObj[sanitize(col.column_name)] = val;

Loading…
Cancel
Save