aboutsummaryrefslogtreecommitdiffstats
path: root/database/migrations/1566385379883_service_schema.ts
blob: cdaff731fa7302ec134e02d477836e28e7f40144 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { BaseSchema } from '@adonisjs/lucid/schema';

export default class extends BaseSchema {
  protected tableName = 'services';

  public async up(): Promise<void> {
    this.schema.createTable(this.tableName, table => {
      table.increments();
      table.string('userId', 80).notNullable();
      table.string('serviceId', 80).notNullable();
      table.string('name', 80).notNullable();
      table.string('recipeId', 254).notNullable();
      table.json('settings');
      table.timestamps();
    });
  }

  public async down(): Promise<void> {
    this.schema.dropTable(this.tableName);
  }
}