20 lines
696 B
TypeScript
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)
|
|
}
|
|
} |