Add dashboard creation flow

This commit is contained in:
rijkvanzanten
2021-05-25 18:18:17 -04:00
parent 56841ca66b
commit c79b48e08f
7 changed files with 185 additions and 10 deletions

View File

@@ -3,8 +3,8 @@ import { Knex } from 'knex';
export async function up(knex: Knex): Promise<void> {
await knex.schema.createTable('directus_dashboards', (table) => {
table.uuid('id').primary();
table.string('name');
table.string('icon', 30);
table.string('name').notNullable();
table.string('icon', 30).notNullable().defaultTo('dashboard');
table.text('note');
table.timestamp('date_created').defaultTo(knex.fn.now());
table.uuid('user_created').references('id').inTable('directus_users').onDelete('SET NULL');
@@ -14,14 +14,15 @@ export async function up(knex: Knex): Promise<void> {
table.uuid('id').primary();
table.uuid('dashboard').notNullable().references('id').inTable('directus_dashboards').onDelete('CASCADE');
table.string('name');
table.string('icon', 30);
table.string('icon', 30).defaultTo('insert_chart');
table.string('color', 10);
table.boolean('show_header').notNullable().defaultTo(true);
table.text('note');
table.string('type');
table.integer('position_x');
table.integer('position_y');
table.integer('width');
table.integer('height');
table.string('type').notNullable();
table.integer('position_x').notNullable();
table.integer('position_y').notNullable();
table.integer('width').notNullable();
table.integer('height').notNullable();
table.json('options');
table.timestamp('date_created').defaultTo(knex.fn.now());
table.uuid('user_created').references('id').inTable('directus_users').onDelete('SET NULL');