adonis-fullstack-app/database/migrations/1503248427886_token.js
Luiz Felipe 550bcd891d style(migration): use parentheses in arrow function
* Update 1503248427885_user.js
* Update 1503248427886_token.js
2018-06-05 17:53:20 +05:30

23 lines
500 B
JavaScript

'use strict'
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