Files
duty-schedule-api/database/migrations/1634969878254_nonces.ts
2021-10-23 09:35:53 +02:00

23 lines
655 B
TypeScript

import BaseSchema from '@ioc:Adonis/Lucid/Schema'
export default class Nonces extends BaseSchema {
protected tableName = 'nonces'
public async up () {
this.schema.createTable(this.tableName, (table) => {
/**
* Uses timestamptz for PostgreSQL and DATETIME2 for MSSQL
*/
table.timestamp('created_at', { useTz: true })
table.timestamp('updated_at', { useTz: true })
table.timestamp('expiry_date', { useTz: true}).notNullable()
table.string('request_id').unique().notNullable()
table.string('nonce').unique().notNullable()
})
}
public async down () {
this.schema.dropTable(this.tableName)
}
}