aboutsummaryrefslogtreecommitdiffstats
path: root/database/migrations/1612629845398_users_update_schema.ts
blob: 8831ea497426d9d50e69bdf680282a53d05023b8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import BaseSchema from '@ioc:Adonis/Lucid/Schema';

export default class extends BaseSchema {
  public async up(): Promise<void> {
    this.schema.alterTable('users', table => {
      table.string('lastname', 80).notNullable().defaultTo('');
    });
  }

  public async down(): Promise<void> {
    this.schema.alterTable('users', table => {
      table.dropColumn('lastname');
    });
  }
}