Browse Source

wip(nocodb): add disable / enable triggers draft

pull/5642/head
Wing-Kam Wong 2 years ago
parent
commit
cfcaca3ee6
  1. 12
      packages/nocodb/src/version-upgrader/ncDateTimeUpgrader.ts

12
packages/nocodb/src/version-upgrader/ncDateTimeUpgrader.ts

@ -113,6 +113,12 @@ export default async function ({ ncMeta }: NcUpgraderCtx) {
.filter((c) => c.pk) .filter((c) => c.pk)
.map((c) => c.column_name); .map((c) => c.column_name);
// disable triggers for pg / mssql
if (knex.clientType() === 'pg' || knex.clientType() === 'mssql') {
// TODO: get triggerList from client
// TODO: disable trigger
}
const records = await knex(getTnPath(knex, model)).select(); const records = await knex(getTnPath(knex, model)).select();
for (const record of records) { for (const record of records) {
@ -163,6 +169,12 @@ export default async function ({ ncMeta }: NcUpgraderCtx) {
// throw general error // throw general error
throw e; throw e;
} }
} finally {
// enable triggers for pg / mssql back
if (knex.clientType() === 'pg' || knex.clientType() === 'mssql') {
// TODO: get triggerList from client
// TODO: enable trigger
}
} }
} }
} }

Loading…
Cancel
Save