mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-14 12:14:33 +01:00
Add form migration
This commit is contained in:
20
database/migrations/1618661863952_forms.ts
Normal file
20
database/migrations/1618661863952_forms.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
|
||||
|
||||
export default class Forms extends BaseSchema {
|
||||
protected tableName = 'forms'
|
||||
|
||||
public async up () {
|
||||
this.schema.createTable(this.tableName, (table) => {
|
||||
table.increments('id')
|
||||
table.string('name')
|
||||
table.string('email')
|
||||
table.string('subject')
|
||||
table.string('content')
|
||||
table.timestamps(true)
|
||||
})
|
||||
}
|
||||
|
||||
public async down () {
|
||||
this.schema.dropTable(this.tableName)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user