Files
artdanj-api/database/migrations/1618661863952_forms.ts

21 lines
542 B
TypeScript

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').primary()
table.string('name').notNullable()
table.string('email').notNullable()
table.string('subject').notNullable()
table.string('content').notNullable()
table.timestamps(true, true)
})
}
public async down () {
this.schema.dropTable(this.tableName)
}
}