Browse Source

feat(nocodb): add a migration script nc_026_add_comparison_sub_op to add a new field comparison_sub_op for FILTER_EXP

pull/5185/head
Wing-Kam Wong 2 years ago
parent
commit
80c6ace33e
  1. 4
      packages/nocodb/src/lib/migrations/XcMigrationSourcev2.ts
  2. 16
      packages/nocodb/src/lib/migrations/v2/nc_026_add_comparison_sub_op.ts

4
packages/nocodb/src/lib/migrations/XcMigrationSourcev2.ts

@ -13,6 +13,7 @@ import * as nc_022_qr_code_column_type from './v2/nc_022_qr_code_column_type';
import * as nc_023_multiple_source from './v2/nc_023_multiple_source';
import * as nc_024_barcode_column_type from './v2/nc_024_barcode_column_type';
import * as nc_025_add_row_height from './v2/nc_025_add_row_height';
import * as nc_026_add_comparison_sub_op from './v2/nc_026_add_comparison_sub_op';
// Create a custom migration source class
export default class XcMigrationSourcev2 {
@ -37,6 +38,7 @@ export default class XcMigrationSourcev2 {
'nc_023_multiple_source',
'nc_024_barcode_column_type',
'nc_025_add_row_height',
'nc_026_add_comparison_sub_op',
]);
}
@ -76,6 +78,8 @@ export default class XcMigrationSourcev2 {
return nc_024_barcode_column_type;
case 'nc_025_add_row_height':
return nc_025_add_row_height;
case 'nc_026_add_comparison_sub_op':
return nc_026_add_comparison_sub_op;
}
}
}

16
packages/nocodb/src/lib/migrations/v2/nc_026_add_comparison_sub_op.ts

@ -0,0 +1,16 @@
import { Knex } from 'knex';
import { MetaTable } from '../../utils/globals';
const up = async (knex: Knex) => {
await knex.schema.alterTable(MetaTable.FILTER_EXP, (table) => {
table.string('comparison_sub_op');
});
};
const down = async (knex) => {
await knex.schema.alterTable(MetaTable.FILTER_EXP, (table) => {
table.dropColumns('comparison_sub_op');
});
};
export { up, down };
Loading…
Cancel
Save