mirror of https://github.com/nocodb/nocodb
DarkPhoenix2704
10 months ago
5 changed files with 321 additions and 0 deletions
@ -0,0 +1,64 @@
|
||||
import type { Knex } from 'knex'; |
||||
import { MetaTable } from '~/utils/globals'; |
||||
|
||||
const up = async (knex: Knex) => { |
||||
await knex.schema.createTable(MetaTable.CALANDER_VIEW, (table) => { |
||||
table.string('fk_view_id', 20).primary(); |
||||
|
||||
table.string('base_id', 20); |
||||
|
||||
table.string('source_id', 128); |
||||
|
||||
table.string('title'); |
||||
|
||||
table.string('fk_cover_image_col_id', 20); |
||||
|
||||
table.text('meta'); |
||||
|
||||
table.dateTime('created_at'); |
||||
table.dateTime('updated_at'); |
||||
}); |
||||
|
||||
await knex.schema.createTable(MetaTable.CALANDER_VIEW_COLUMNS, (table) => { |
||||
table.string('id', 20).primary().notNullable(); |
||||
|
||||
table.string('base_id', 20); |
||||
table.string('source_id', 128); |
||||
|
||||
table.string('fk_view_id', 20); |
||||
|
||||
table.string('fk_column_id', 20); |
||||
|
||||
table.boolean('show'); |
||||
|
||||
table.boolean('bold'); |
||||
|
||||
table.boolean('underline'); |
||||
|
||||
table.boolean('italic'); |
||||
|
||||
table.float('order'); |
||||
|
||||
table.timestamps(true, true); |
||||
}); |
||||
|
||||
await knex.schema.createTable(MetaTable.CALANDER_VIEW_RANGE, (table) => { |
||||
table.string('id', 20).primary().notNullable(); |
||||
|
||||
table.string('fk_view_id', 20); |
||||
|
||||
table.string('fk_to_column_id', 20); |
||||
|
||||
table.string('fk_from_column_id', 20); |
||||
|
||||
table.timestamps(true, true); |
||||
}); |
||||
}; |
||||
|
||||
const down = async (knex: Knex) => { |
||||
await knex.schema.dropTable(MetaTable.CALANDER_VIEW); |
||||
await knex.schema.dropTable(MetaTable.CALANDER_VIEW_COLUMNS); |
||||
await knex.schema.dropTable(MetaTable.CALANDER_VIEW_RANGE); |
||||
}; |
||||
|
||||
export { up, down }; |
Loading…
Reference in new issue