Browse Source

Merge pull request #2174 from willnewii/fix/alter_hooklog_payload_types

fix: alter_hooklog_payload_types
pull/2197/head
աɨռɢӄաօռɢ 2 years ago committed by GitHub
parent
commit
7756126b58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      packages/nocodb/src/lib/noco/common/XcMigrationSourcev2.ts
  2. 42
      packages/nocodb/src/lib/noco/migrationsv2/nc_016_alter_hooklog_payload_types.ts

6
packages/nocodb/src/lib/noco/common/XcMigrationSourcev2.ts

@ -3,6 +3,7 @@ import * as nc_012_alter_column_data_types from '../migrationsv2/nc_012_alter_co
import * as nc_013_sync_source from '../migrationsv2/nc_013_sync_source'; import * as nc_013_sync_source from '../migrationsv2/nc_013_sync_source';
import * as nc_014_alter_column_data_types from '../migrationsv2/nc_014_alter_column_data_types'; import * as nc_014_alter_column_data_types from '../migrationsv2/nc_014_alter_column_data_types';
import * as nc_015_add_meta_col_in_column_table from '../migrationsv2/nc_015_add_meta_col_in_column_table'; import * as nc_015_add_meta_col_in_column_table from '../migrationsv2/nc_015_add_meta_col_in_column_table';
import * as nc_016_alter_hooklog_payload_types from '../migrationsv2/nc_016_alter_hooklog_payload_types';
// Create a custom migration source class // Create a custom migration source class
export default class XcMigrationSourcev2 { export default class XcMigrationSourcev2 {
@ -16,7 +17,8 @@ export default class XcMigrationSourcev2 {
'nc_012_alter_column_data_types', 'nc_012_alter_column_data_types',
'nc_013_sync_source', 'nc_013_sync_source',
'nc_014_alter_column_data_types', 'nc_014_alter_column_data_types',
'nc_015_add_meta_col_in_column_table' 'nc_015_add_meta_col_in_column_table',
'nc_016_alter_hooklog_payload_types'
]); ]);
} }
@ -36,6 +38,8 @@ export default class XcMigrationSourcev2 {
return nc_014_alter_column_data_types; return nc_014_alter_column_data_types;
case 'nc_015_add_meta_col_in_column_table': case 'nc_015_add_meta_col_in_column_table':
return nc_015_add_meta_col_in_column_table; return nc_015_add_meta_col_in_column_table;
case 'nc_016_alter_hooklog_payload_types':
return nc_016_alter_hooklog_payload_types;
} }
} }
} }

42
packages/nocodb/src/lib/noco/migrationsv2/nc_016_alter_hooklog_payload_types.ts

@ -0,0 +1,42 @@
import Knex from 'knex';
import { MetaTable } from '../../utils/globals';
const up = async (knex: Knex) => {
if (knex.client.config.client !== 'sqlite3') {
await knex.schema.alterTable(MetaTable.HOOK_LOGS, table => {
table.text('payload').alter();
});
}
};
const down = async knex => {
if (knex.client.config.client !== 'sqlite3') {
await knex.schema.alterTable(MetaTable.HOOK_LOGS, table => {
table.boolean('payload').alter();
});
}
};
export { up, down };
/**
* @copyright Copyright (c) 2022, Xgene Cloud Ltd
*
* @author willnewii <willnewii@163.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
Loading…
Cancel
Save