diff options
Diffstat (limited to 'database/migrations/1566554359294_workspace_schema.ts')
-rw-r--r-- | database/migrations/1566554359294_workspace_schema.ts | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/database/migrations/1566554359294_workspace_schema.ts b/database/migrations/1566554359294_workspace_schema.ts new file mode 100644 index 0000000..77e1189 --- /dev/null +++ b/database/migrations/1566554359294_workspace_schema.ts | |||
@@ -0,0 +1,22 @@ | |||
1 | import BaseSchema from '@ioc:Adonis/Lucid/Schema'; | ||
2 | |||
3 | export default class extends BaseSchema { | ||
4 | protected tableName = 'workspaces'; | ||
5 | |||
6 | public async up(): Promise<void> { | ||
7 | this.schema.createTable(this.tableName, table => { | ||
8 | table.increments(); | ||
9 | table.string('workspaceId', 80).notNullable().unique(); | ||
10 | table.string('userId', 80).notNullable(); | ||
11 | table.string('name', 80).notNullable(); | ||
12 | table.integer('order'); | ||
13 | table.json('services'); | ||
14 | table.json('data'); | ||
15 | table.timestamps(); | ||
16 | }); | ||
17 | } | ||
18 | |||
19 | public async down(): Promise<void> { | ||
20 | this.schema.dropTable(this.tableName); | ||
21 | } | ||
22 | } | ||