21 lines
510 B
TypeScript
21 lines
510 B
TypeScript
import { BaseSchema } from '@adonisjs/lucid/schema'
|
|
|
|
export default class extends BaseSchema {
|
|
protected tableName = 'scenarios'
|
|
|
|
async up() {
|
|
this.schema.createTable(this.tableName, (table) => {
|
|
table.increments('id')
|
|
table.string('title').notNullable()
|
|
table.text('body').notNullable()
|
|
table.integer('timeout').notNullable()
|
|
table.boolean('isReboot').defaultTo(false)
|
|
table.timestamps()
|
|
})
|
|
}
|
|
|
|
async down() {
|
|
this.schema.dropTable(this.tableName)
|
|
}
|
|
}
|