auction-scrapper/database/migrations/1760511172177_create_create_auctions_table.ts
Vakula Uladimir 12f005e335 init
2025-10-17 11:27:52 +03:00

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)
}
}