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

19 lines
573 B
TypeScript

import { BaseSchema } from '@adonisjs/lucid/schema'
export default class extends BaseSchema {
protected tableName = 'keywords'
async up() {
this.schema.createTable(this.tableName, (table) => {
table.increments('id').primary()
table.string('keyword', 255).notNullable().unique()
table.boolean('is_active').notNullable().defaultTo(true)
table.timestamp('created_at', { useTz: true }).notNullable()
table.timestamp('updated_at', { useTz: true }).notNullable()
})
}
async down() {
this.schema.dropTable(this.tableName)
}
}