|
|
@ -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
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|