Fix migration

Signed-off-by: Arthur DANJOU <arthurdanjou@outlook.fr>
This commit is contained in:
2021-07-03 18:36:17 +02:00
parent c7902091d7
commit c05e72d664
2 changed files with 18 additions and 1 deletions

View File

@@ -11,7 +11,7 @@ export default class GuestbookMessages extends BaseSchema {
.unsigned()
.references('users.id')
.onDelete('CASCADE')
table.text('message')
table.string('message')
table.timestamps(true, true)
})
}

View File

@@ -0,0 +1,17 @@
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
export default class GuestbookMessages extends BaseSchema {
protected tableName = 'guestbook_messages'
public async up() {
await this.schema.table(this.tableName, (table) => {
table.text('message')
})
}
public async down() {
await this.schema.table(this.tableName, (table) => {
table.dropColumn('message')
})
}
}