aboutsummaryrefslogtreecommitdiffstats
path: root/database/migrations/1612629845398_users_update_schema.ts
blob: 76dc8167193662a33042c34f7299ef403098a37d (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')
    })
  }
}