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

20 lines
696 B
TypeScript

import { BaseSchema } from '@adonisjs/lucid/schema'
export default class extends BaseSchema {
protected tableName = 'notifications'
async up() {
this.schema.createTable(this.tableName, (table) => {
table.increments('id').primary()
table.integer('auction_id').unsigned().notNullable().references('id').inTable('auctions').onDelete('CASCADE')
table.string('notification_type', 100).notNullable()
table.timestamp('sent_at', { useTz: true }).notNullable()
table.timestamp('created_at', { useTz: true }).notNullable()
table.timestamp('updated_at', { useTz: true }).notNullable()
})
}
async down() {
this.schema.dropTable(this.tableName)
}
}