23 lines
786 B
TypeScript
23 lines
786 B
TypeScript
import { BaseSchema } from '@adonisjs/lucid/schema'
|
|
|
|
export default class extends BaseSchema {
|
|
protected tableName = 'parse_logs'
|
|
|
|
async up() {
|
|
this.schema.createTable(this.tableName, (table) => {
|
|
table.increments('id').primary()
|
|
table.string('parse_type', 100).notNullable()
|
|
table.string('status', 50).notNullable()
|
|
table.integer('items_found').notNullable().defaultTo(0)
|
|
table.text('errors').nullable()
|
|
table.timestamp('started_at', { useTz: true }).notNullable()
|
|
table.timestamp('completed_at', { useTz: true }).nullable()
|
|
table.timestamp('created_at', { useTz: true }).notNullable()
|
|
table.timestamp('updated_at', { useTz: true }).notNullable()
|
|
})
|
|
}
|
|
|
|
async down() {
|
|
this.schema.dropTable(this.tableName)
|
|
}
|
|
} |