mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-14 20:19:26 +01:00
@@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
17
database/migrations/1625330080117_guestbook_messages.ts
Normal file
17
database/migrations/1625330080117_guestbook_messages.ts
Normal 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')
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user