aboutsummaryrefslogtreecommitdiffstats
path: root/database/migrations/1612629845398_users_update_schema.ts
blob: 2ee4ee4ba9d660cdea2426d098922560adc60673 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { BaseSchema } from '@adonisjs/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');
    });
  }
}