mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-31 20:07:54 +01:00
@@ -11,7 +11,7 @@ export default class GuestbookMessages extends BaseSchema {
|
|||||||
.unsigned()
|
.unsigned()
|
||||||
.references('users.id')
|
.references('users.id')
|
||||||
.onDelete('CASCADE')
|
.onDelete('CASCADE')
|
||||||
table.text('message')
|
table.string('message')
|
||||||
table.timestamps(true, true)
|
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