import BaseSchema from '@ioc:Adonis/Lucid/Schema'

export default class extends BaseSchema {
    protected tableName = 'banners'

    public async up() {
        this.schema.createTable(this.tableName, (table) => {
            table.increments('id')
            table.datetime('created_at', { useTz: true })
            table.datetime('updated_at', { useTz: true })
            table.string('title').notNullable()
            table.string('img').notNullable()
            table.string('link').notNullable()
            table.string('desc').notNullable()
        })
    }

    public async down() {
        this.schema.dropTable(this.tableName)
    }
}
