26 lines
892 B
TypeScript
26 lines
892 B
TypeScript
import { BaseSchema } from '@adonisjs/lucid/schema'
|
|
|
|
export default class extends BaseSchema {
|
|
protected tableName = 'auctions'
|
|
|
|
async up() {
|
|
this.schema.createTable(this.tableName, (table) => {
|
|
table.increments('id').primary()
|
|
table.string('auction_num', 255).notNullable().unique()
|
|
table.string('title', 500).notNullable()
|
|
table.text('description').nullable()
|
|
table.string('organization', 500).nullable()
|
|
table.string('status', 100).nullable()
|
|
table.decimal('price', 15, 2).nullable()
|
|
table.timestamp('deadline', { useTz: true }).nullable()
|
|
table.string('url', 1000).nullable()
|
|
table.json('raw_data').nullable()
|
|
table.timestamp('created_at', { useTz: true }).notNullable()
|
|
table.timestamp('updated_at', { useTz: true }).notNullable()
|
|
})
|
|
}
|
|
|
|
async down() {
|
|
this.schema.dropTable(this.tableName)
|
|
}
|
|
} |