From b7b0d8d9cf7cd71d1c125055b8f9488297a87969 Mon Sep 17 00:00:00 2001 From: flisowna Date: Thu, 2 Feb 2023 11:45:25 +0100 Subject: [PATCH] rename migration --- .../migrations/v2/nc_026_map_view_column.ts | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 packages/nocodb/src/lib/migrations/v2/nc_026_map_view_column.ts diff --git a/packages/nocodb/src/lib/migrations/v2/nc_026_map_view_column.ts b/packages/nocodb/src/lib/migrations/v2/nc_026_map_view_column.ts new file mode 100644 index 0000000000..d1f22fce9a --- /dev/null +++ b/packages/nocodb/src/lib/migrations/v2/nc_026_map_view_column.ts @@ -0,0 +1,31 @@ +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); + }); +}; + +const down = async (knex) => { + await knex.schema.dropTable(MetaTable.MAP_VIEW_COLUMNS); +}; + +export { up, down };