fix: add pastStudentId migration
This commit is contained in:
parent
233f539b07
commit
23ce4e22e8
1 changed files with 6 additions and 7 deletions
|
|
@ -1,18 +1,17 @@
|
|||
import { BaseSchema } from '@adonisjs/lucid/schema'
|
||||
|
||||
export default class extends BaseSchema {
|
||||
protected tableName = 'add_past_student_id_to_users'
|
||||
protected tableName = 'users'
|
||||
|
||||
async up() {
|
||||
this.schema.createTable(this.tableName, (table) => {
|
||||
table.increments('id')
|
||||
|
||||
table.timestamp('created_at')
|
||||
table.timestamp('updated_at')
|
||||
this.schema.alterTable(this.tableName, (table) => {
|
||||
table.integer('past_student_id').unsigned().nullable()
|
||||
})
|
||||
}
|
||||
|
||||
async down() {
|
||||
this.schema.dropTable(this.tableName)
|
||||
this.schema.alterTable(this.tableName, (table) => {
|
||||
table.dropColumn('past_student_id')
|
||||
})
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue