From d95f902a04c32350ffef4e40b3b5d70201950dc3 Mon Sep 17 00:00:00 2001 From: flisowna Date: Thu, 23 Feb 2023 19:54:30 +0100 Subject: [PATCH] adjust order in map_view migration file --- .../src/lib/migrations/v2/nc_026_map_view.ts | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/packages/nocodb/src/lib/migrations/v2/nc_026_map_view.ts b/packages/nocodb/src/lib/migrations/v2/nc_026_map_view.ts index aa118731ff..17b3d68e14 100644 --- a/packages/nocodb/src/lib/migrations/v2/nc_026_map_view.ts +++ b/packages/nocodb/src/lib/migrations/v2/nc_026_map_view.ts @@ -1,27 +1,6 @@ import { MetaTable } from '../../utils/globals'; const up = async (knex) => { - await knex.schema.createTable(MetaTable.MAP_VIEW_COLUMNS, (table) => { - table.string('id', 20).primary().notNullable(); - - table.string('base_id', 20); - table.string('project_id', 128); - - table.string('fk_view_id', 20); - table.foreign('fk_view_id').references(`${MetaTable.MAP_VIEW}.fk_view_id`); - table.string('fk_column_id', 20); - table.foreign('fk_column_id').references(`${MetaTable.COLUMNS}.id`); - - table.string('uuid'); - - table.string('label'); - table.string('help'); - - table.boolean('show'); - table.float('order'); - - table.timestamps(true, true); - }); await knex.schema.createTable(MetaTable.MAP_VIEW, (table) => { table.string('fk_view_id', 20).primary(); table.foreign('fk_view_id').references(`${MetaTable.VIEWS}.id`); @@ -43,11 +22,32 @@ const up = async (knex) => { table.dateTime('created_at'); table.dateTime('updated_at'); }); + await knex.schema.createTable(MetaTable.MAP_VIEW_COLUMNS, (table) => { + table.string('id', 20).primary().notNullable(); + + table.string('base_id', 20); + table.string('project_id', 128); + + table.string('fk_view_id', 20); + table.foreign('fk_view_id').references(`${MetaTable.MAP_VIEW}.fk_view_id`); + table.string('fk_column_id', 20); + table.foreign('fk_column_id').references(`${MetaTable.COLUMNS}.id`); + + table.string('uuid'); + + table.string('label'); + table.string('help'); + + table.boolean('show'); + table.float('order'); + + table.timestamps(true, true); + }); }; const down = async (knex) => { - await knex.schema.dropTable(MetaTable.MAP_VIEW_COLUMNS); await knex.schema.dropTable(MetaTable.MAP_VIEW); + await knex.schema.dropTable(MetaTable.MAP_VIEW_COLUMNS); }; export { up, down };