adonis-fullstack-app/database/migrations/1503248427886_token.js
2017-08-20 22:39:25 +05:30

22 lines
444 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', 40).notNullable().unique()
table.boolean('is_revoked').defaultTo(false)
table.timestamps()
})
}
down () {
this.drop('tokens')
}
}
module.exports = TokensSchema