This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
seepur/database/migrations/1503248427886_token.js
2020-01-13 20:57:43 -05:00

23 lines
552 B
JavaScript

'use strict'
/** @type {import('@adonisjs/lucid/src/Schema')} */
const Schema = use('Schema')
class TokensSchema extends Schema {
up () {
this.create('tokens', (table) => {
table.increments()
table.integer('user_id').unsigned().references('id').inTable('users')
table.string('token', 255).notNullable().unique().index()
table.string('type', 80).notNullable()
table.boolean('is_revoked').defaultTo(false)
table.timestamps()
})
}
down () {
this.drop('tokens')
}
}
module.exports = TokensSchema