diff --git a/packages/nocodb/src/lib/migrations/XcMigrationSourcev2.ts b/packages/nocodb/src/lib/migrations/XcMigrationSourcev2.ts index 6d25a31f7b..a724a73e4c 100644 --- a/packages/nocodb/src/lib/migrations/XcMigrationSourcev2.ts +++ b/packages/nocodb/src/lib/migrations/XcMigrationSourcev2.ts @@ -7,9 +7,7 @@ import * as nc_016_alter_hooklog_payload_types from './v2/nc_016_alter_hooklog_p import * as nc_017_add_user_token_version_column from './v2/nc_017_add_user_token_version_column'; import * as nc_018_add_meta_in_view from './v2/nc_018_add_meta_in_view'; import * as nc_019_add_meta_in_meta_tables from './v2/nc_019_add_meta_in_meta_tables'; -import * as nc_020_add_kanban_meta_col from './v2/nc_020_add_kanban_meta_col'; -import * as nc_021_rename_kanban_grp_col_id from './v2/nc_021_rename_kanban_grp_col_id'; -import * as nc_022_add_kanban_fk_cover_image_col_id from './v2/nc_022_add_kanban_fk_cover_image_col_id'; +import * as nc_020_kanban_view from './v2/nc_020_kanban_view'; // Create a custom migration source class export default class XcMigrationSourcev2 { @@ -28,9 +26,7 @@ export default class XcMigrationSourcev2 { 'nc_017_add_user_token_version_column', 'nc_018_add_meta_in_view', 'nc_019_add_meta_in_meta_tables', - 'nc_020_add_kanban_meta_col', - 'nc_021_rename_kanban_grp_col_id', - 'nc_022_add_kanban_fk_cover_image_col_id' + 'nc_020_kanban_view', ]); } @@ -58,12 +54,8 @@ export default class XcMigrationSourcev2 { return nc_018_add_meta_in_view; case 'nc_019_add_meta_in_meta_tables': return nc_019_add_meta_in_meta_tables; - case 'nc_020_add_kanban_meta_col': - return nc_020_add_kanban_meta_col; - case 'nc_021_rename_kanban_grp_col_id': - return nc_021_rename_kanban_grp_col_id; - case 'nc_022_add_kanban_fk_cover_image_col_id': - return nc_022_add_kanban_fk_cover_image_col_id; + case 'nc_020_kanban_view': + return nc_020_kanban_view; } } } diff --git a/packages/nocodb/src/lib/migrations/v2/nc_020_add_kanban_meta_col.ts b/packages/nocodb/src/lib/migrations/v2/nc_020_add_kanban_meta_col.ts deleted file mode 100644 index fe42df71dd..0000000000 --- a/packages/nocodb/src/lib/migrations/v2/nc_020_add_kanban_meta_col.ts +++ /dev/null @@ -1,40 +0,0 @@ -import Knex from 'knex'; -import { MetaTable } from '../../utils/globals'; - -const up = async (knex: Knex) => { - await knex.schema.alterTable(MetaTable.KANBAN_VIEW, (table) => { - table.string('grp_column_id'); - table.text('meta'); - }); -}; - -const down = async (knex) => { - await knex.schema.alterTable(MetaTable.KANBAN_VIEW, (table) => { - table.dropColumns('grp_column_id'); - table.dropColumns('meta'); - }); -}; - -export { up, down }; - -/** - * @copyright Copyright (c) 2021, Xgene Cloud Ltd - * - * @author Wing-Kam Wong - * - * @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 . - * - */ diff --git a/packages/nocodb/src/lib/migrations/v2/nc_022_add_kanban_fk_cover_image_col_id.ts b/packages/nocodb/src/lib/migrations/v2/nc_020_kanban_view.ts similarity index 85% rename from packages/nocodb/src/lib/migrations/v2/nc_022_add_kanban_fk_cover_image_col_id.ts rename to packages/nocodb/src/lib/migrations/v2/nc_020_kanban_view.ts index e7c068a7d3..f68385e4b9 100644 --- a/packages/nocodb/src/lib/migrations/v2/nc_022_add_kanban_fk_cover_image_col_id.ts +++ b/packages/nocodb/src/lib/migrations/v2/nc_020_kanban_view.ts @@ -3,15 +3,24 @@ import { MetaTable } from '../../utils/globals'; const up = async (knex: Knex) => { await knex.schema.alterTable(MetaTable.KANBAN_VIEW, (table) => { + table.string('fk_grp_col_id', 20); + table + .foreign('fk_grp_col_id') + .references(`${MetaTable.COLUMNS}.id`); + table.string('fk_cover_image_col_id', 20); table .foreign('fk_cover_image_col_id') .references(`${MetaTable.COLUMNS}.id`); + + table.text('meta'); }); }; const down = async (knex) => { await knex.schema.alterTable(MetaTable.KANBAN_VIEW, (table) => { + table.dropColumns('meta'); + table.dropColumns('fk_grp_col_id'); table.dropColumns('fk_cover_image_col_id'); }); }; diff --git a/packages/nocodb/src/lib/migrations/v2/nc_021_rename_kanban_grp_col_id.ts b/packages/nocodb/src/lib/migrations/v2/nc_021_rename_kanban_grp_col_id.ts deleted file mode 100644 index 6f62cb8cfd..0000000000 --- a/packages/nocodb/src/lib/migrations/v2/nc_021_rename_kanban_grp_col_id.ts +++ /dev/null @@ -1,41 +0,0 @@ -import Knex from 'knex'; -import { MetaTable } from '../../utils/globals'; - -const up = async (knex: Knex) => { - await knex.schema.alterTable(MetaTable.KANBAN_VIEW, (table) => { - table.renameColumn('grp_column_id', 'fk_grp_col_id') - table - .foreign('fk_grp_col_id') - .references(`${MetaTable.COLUMNS}.id`); - }); -}; - -const down = async (knex) => { - await knex.schema.alterTable(MetaTable.KANBAN_VIEW, (table) => { - table.dropColumns('fk_grp_col_id'); - }); -}; - -export { up, down }; - -/** - * @copyright Copyright (c) 2021, Xgene Cloud Ltd - * - * @author Wing-Kam Wong - * - * @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 . - * - */