From b018adf240679ec59a7344e30be39400f1ecd8af Mon Sep 17 00:00:00 2001 From: vantezzen Date: Thu, 22 Aug 2019 11:12:36 +0200 Subject: Initial commit --- database/migrations/1503250034280_token.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 database/migrations/1503250034280_token.js (limited to 'database/migrations/1503250034280_token.js') diff --git a/database/migrations/1503250034280_token.js b/database/migrations/1503250034280_token.js new file mode 100644 index 0000000..c8bb9fc --- /dev/null +++ b/database/migrations/1503250034280_token.js @@ -0,0 +1,23 @@ +'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 -- cgit v1.2.3-70-g09d2