Browse Source

fix: avoid removing/resetting default value and pg trigger

pull/7304/head
Pranav C 12 months ago
parent
commit
5d0a090325
  1. 11
      packages/nocodb/src/version-upgrader/ncXcdbCreatedAndUpdatedTimeUpgrader.ts

11
packages/nocodb/src/version-upgrader/ncXcdbCreatedAndUpdatedTimeUpgrader.ts

@ -17,6 +17,7 @@ import { Altered } from '~/services/columns.service';
const logger = new Logger('ncXcdbCreatedAndUpdatedTimeUpgrader');
/* Enable if planning to remove trigger
async function deletePgTrigger({
column,
ncMeta,
@ -36,6 +37,7 @@ async function deletePgTrigger({
]);
await ncMeta.knex.raw(`DROP FUNCTION IF EXISTS ??()`, [triggerFnName]);
}
*/
async function upgradeModels({
ncMeta,
@ -71,19 +73,14 @@ async function upgradeModels({
ncMeta,
);
/* Enable if planning to remove trigger
if (source.type === 'pg') {
// delete pg trigger if exists
await deletePgTrigger({ column, ncMeta, model });
}
}*/
}
if (column.uidt === 'updated_at') {
isLastModifiedTimeExists = true;
Object.assign(column, {
uidt: UITypes.LastModifiedTime,
system: true,
cdf: '',
au: false,
});
await Column.update(
column.id,
{

Loading…
Cancel
Save