mirror of
https://github.com/directus/directus.git
synced 2026-02-01 05:05:04 -05:00
Add new system tables
This commit is contained in:
32
api/src/database/migrations/20210525A-add-insights.ts
Normal file
32
api/src/database/migrations/20210525A-add-insights.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
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.timestamp('date_created');
|
||||
table.timestamp('user_created');
|
||||
});
|
||||
|
||||
await knex.schema.createTable('directus_panels', (table) => {
|
||||
table.uuid('id').primary();
|
||||
table.string('name');
|
||||
table.string('icon', 30);
|
||||
table.string('color', 10);
|
||||
table.text('note');
|
||||
table.string('type');
|
||||
table.integer('position_x');
|
||||
table.integer('position_y');
|
||||
table.integer('width');
|
||||
table.integer('height');
|
||||
table.json('options');
|
||||
table.timestamp('date_created');
|
||||
table.timestamp('user_created');
|
||||
});
|
||||
}
|
||||
|
||||
export async function down(knex: Knex): Promise<void> {
|
||||
await knex.schema.dropTable('directus_dashboards');
|
||||
await knex.schema.dropTable('directus_panels');
|
||||
}
|
||||
11
api/src/database/system-data/fields/dashboards.yaml
Normal file
11
api/src/database/system-data/fields/dashboards.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
table: directus_dashboards
|
||||
|
||||
fields:
|
||||
- field: id
|
||||
special: uuid
|
||||
- field: name
|
||||
- field: icon
|
||||
- field: date_created
|
||||
special: date-created
|
||||
- field: user_created
|
||||
special: user-created
|
||||
19
api/src/database/system-data/fields/panels.yaml
Normal file
19
api/src/database/system-data/fields/panels.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
table: directus_panels
|
||||
|
||||
fields:
|
||||
- field: id
|
||||
special: uuid
|
||||
- field: name
|
||||
- field: icon
|
||||
- field: color
|
||||
- field: note
|
||||
- field: type
|
||||
- field: position_x
|
||||
- field: position_y
|
||||
- field: width
|
||||
- field: height
|
||||
- field: options
|
||||
- field: date_created
|
||||
special: date-created
|
||||
- field: user_created
|
||||
special: user-created
|
||||
Reference in New Issue
Block a user