aboutsummaryrefslogtreecommitdiffstats
path: root/database/migrations/1566385379883_service_schema.ts
diff options
context:
space:
mode:
Diffstat (limited to 'database/migrations/1566385379883_service_schema.ts')
-rw-r--r--database/migrations/1566385379883_service_schema.ts21
1 files changed, 21 insertions, 0 deletions
diff --git a/database/migrations/1566385379883_service_schema.ts b/database/migrations/1566385379883_service_schema.ts
new file mode 100644
index 0000000..9c3e23d
--- /dev/null
+++ b/database/migrations/1566385379883_service_schema.ts
@@ -0,0 +1,21 @@
1import BaseSchema from '@ioc:Adonis/Lucid/Schema';
2
3export default class extends BaseSchema {
4 protected tableName = 'services';
5
6 public async up(): Promise<void> {
7 this.schema.createTable(this.tableName, table => {
8 table.increments();
9 table.string('userId', 80).notNullable();
10 table.string('serviceId', 80).notNullable();
11 table.string('name', 80).notNullable();
12 table.string('recipeId', 254).notNullable();
13 table.json('settings');
14 table.timestamps();
15 });
16 }
17
18 public async down(): Promise<void> {
19 this.schema.dropTable(this.tableName);
20 }
21}