Browse Source

fix(migration): recreate payload column in mssql

- Dropping existing column won't cause any problem since it only contains boolean value and which is not useful

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/2498/head
Pranav C 3 years ago
parent
commit
efa9e37bfb
  1. 9
      packages/nocodb/src/lib/migrations/v2/nc_016_alter_hooklog_payload_types.ts

9
packages/nocodb/src/lib/migrations/v2/nc_016_alter_hooklog_payload_types.ts

@ -2,7 +2,14 @@ import Knex from 'knex';
import { MetaTable } from '../../utils/globals';
const up = async (knex: Knex) => {
if (knex.client.config.client !== 'sqlite3') {
if (knex.client.config.client === 'mssql') {
await knex.schema.alterTable(MetaTable.HOOK_LOGS, table => {
table.dropColumn('payload');
});
await knex.schema.alterTable(MetaTable.HOOK_LOGS, table => {
table.text('payload');
});
} else if (knex.client.config.client !== 'sqlite3') {
await knex.schema.alterTable(MetaTable.HOOK_LOGS, table => {
table.text('payload').alter();
});

Loading…
Cancel
Save