mirror of
https://github.com/directus/directus.git
synced 2026-02-01 13:54:58 -05:00
Add schema, rest/gql resolvers for insights
This commit is contained in:
@@ -5,12 +5,13 @@ export async function up(knex: Knex): Promise<void> {
|
||||
table.uuid('id').primary();
|
||||
table.string('name');
|
||||
table.string('icon', 30);
|
||||
table.timestamp('date_created');
|
||||
table.timestamp('user_created');
|
||||
table.timestamp('date_created').defaultTo(knex.fn.now());
|
||||
table.uuid('user_created').references('id').inTable('directus_users').onDelete('SET NULL');
|
||||
});
|
||||
|
||||
await knex.schema.createTable('directus_panels', (table) => {
|
||||
table.uuid('id').primary();
|
||||
table.uuid('dashboard').notNullable().references('id').inTable('directus_dashboards').onDelete('CASCADE');
|
||||
table.string('name');
|
||||
table.string('icon', 30);
|
||||
table.string('color', 10);
|
||||
@@ -21,8 +22,8 @@ export async function up(knex: Knex): Promise<void> {
|
||||
table.integer('width');
|
||||
table.integer('height');
|
||||
table.json('options');
|
||||
table.timestamp('date_created');
|
||||
table.timestamp('user_created');
|
||||
table.timestamp('date_created').defaultTo(knex.fn.now());
|
||||
table.uuid('user_created').references('id').inTable('directus_users').onDelete('SET NULL');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ fields:
|
||||
special: uuid
|
||||
- field: name
|
||||
- field: icon
|
||||
- field: panels
|
||||
special: o2m
|
||||
- field: date_created
|
||||
special: date-created
|
||||
- field: user_created
|
||||
|
||||
@@ -54,3 +54,7 @@ data:
|
||||
- many_collection: directus_settings
|
||||
many_field: public_background
|
||||
one_collection: directus_files
|
||||
- many_collection: directus_panels
|
||||
many_field: dashboard
|
||||
one_collection: directus_dashboards
|
||||
one_field: panels
|
||||
|
||||
Reference in New Issue
Block a user