Browse Source

fix: nc_project_v2 already have description field - remove it from latest migration and add missing migration to nocodb-nest

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5575/head
Pranav C 2 years ago
parent
commit
45208895e5
  1. 4
      packages/nocodb-nest/src/meta/migrations/XcMigrationSourcev2.ts
  2. 34
      packages/nocodb-nest/src/meta/migrations/v2/nc_030_add_description_field.ts
  3. 2
      packages/nocodb/src/lib/migrations/XcMigrationSourcev2.ts

4
packages/nocodb-nest/src/meta/migrations/XcMigrationSourcev2.ts

@ -17,6 +17,7 @@ import * as nc_026_map_view from './v2/nc_026_map_view';
import * as nc_027_add_comparison_sub_op from './v2/nc_027_add_comparison_sub_op';
import * as nc_028_add_enable_scanner_in_form_columns_meta_table from './v2/nc_028_add_enable_scanner_in_form_columns_meta_table';
import * as nc_029_webhook from './v2/nc_029_webhook';
import * as nc_030_add_description_field from './v2/nc_030_add_description_field';
// Create a custom migration source class
export default class XcMigrationSourcev2 {
@ -45,6 +46,7 @@ export default class XcMigrationSourcev2 {
'nc_027_add_comparison_sub_op',
'nc_028_add_enable_scanner_in_form_columns_meta_table',
'nc_029_webhook',
'nc_030_add_description_field',
]);
}
@ -92,6 +94,8 @@ export default class XcMigrationSourcev2 {
return nc_028_add_enable_scanner_in_form_columns_meta_table;
case 'nc_029_webhook':
return nc_029_webhook;
case 'nc_030_add_description_field':
return nc_030_add_description_field;
}
}
}

34
packages/nocodb-nest/src/meta/migrations/v2/nc_030_add_description_field.ts

@ -0,0 +1,34 @@
import type { Knex } from 'knex';
import { MetaTable } from '../../meta.service'
const up = async (knex: Knex) => {
await knex.schema.alterTable(MetaTable.BASES, (table) => {
table.string('description', 255);
});
await knex.schema.alterTable(MetaTable.MODELS, (table) => {
table.string('description', 255);
});
await knex.schema.alterTable(MetaTable.VIEWS, (table) => {
table.string('description', 255);
});
await knex.schema.alterTable(MetaTable.COLUMNS, (table) => {
table.string('description', 255);
});
};
const down = async (knex) => {
await knex.schema.alterTable(MetaTable.BASES, (table) => {
table.dropColumn('description');
});
await knex.schema.alterTable(MetaTable.MODELS, (table) => {
table.dropColumn('description');
});
await knex.schema.alterTable(MetaTable.VIEWS, (table) => {
table.dropColumn('description');
});
await knex.schema.alterTable(MetaTable.COLUMNS, (table) => {
table.dropColumn('description');
});
};
export { up, down };

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

@ -46,7 +46,7 @@ export default class XcMigrationSourcev2 {
'nc_027_add_comparison_sub_op',
'nc_028_add_enable_scanner_in_form_columns_meta_table',
'nc_029_webhook',
'nc_030_add_description_field'
'nc_030_add_description_field',
]);
}

Loading…
Cancel
Save