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

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

    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.integer('user_id')
            table.integer('price')
            table.string('type')
            table.integer('series_id')
            table.integer('episode_id')
        })
    }

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