diff options
author | 2019-09-05 11:22:49 +0200 | |
---|---|---|
committer | 2019-09-05 11:22:49 +0200 | |
commit | 29b8334b060dc0c05a509d523ead4b3a30229fef (patch) | |
tree | 4dbfcfb90a3eff31acd219b27557bbdc594f589f /database/migrations/1503250034280_token.js | |
parent | Add cookie notice to login page (diff) | |
download | ferdium-server-29b8334b060dc0c05a509d523ead4b3a30229fef.tar.gz ferdium-server-29b8334b060dc0c05a509d523ead4b3a30229fef.tar.zst ferdium-server-29b8334b060dc0c05a509d523ead4b3a30229fef.zip |
Add eslint
Diffstat (limited to 'database/migrations/1503250034280_token.js')
-rw-r--r-- | database/migrations/1503250034280_token.js | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/database/migrations/1503250034280_token.js b/database/migrations/1503250034280_token.js index c8bb9fc..ad97dba 100644 --- a/database/migrations/1503250034280_token.js +++ b/database/migrations/1503250034280_token.js | |||
@@ -1,23 +1,22 @@ | |||
1 | 'use strict' | ||
2 | 1 | ||
3 | /** @type {import('@adonisjs/lucid/src/Schema')} */ | 2 | /** @type {import('@adonisjs/lucid/src/Schema')} */ |
4 | const Schema = use('Schema') | 3 | const Schema = use('Schema'); |
5 | 4 | ||
6 | class TokensSchema extends Schema { | 5 | class TokensSchema extends Schema { |
7 | up () { | 6 | up() { |
8 | this.create('tokens', (table) => { | 7 | this.create('tokens', (table) => { |
9 | table.increments() | 8 | table.increments(); |
10 | table.integer('user_id').unsigned().references('id').inTable('users') | 9 | table.integer('user_id').unsigned().references('id').inTable('users'); |
11 | table.string('token', 255).notNullable().unique().index() | 10 | table.string('token', 255).notNullable().unique().index(); |
12 | table.string('type', 80).notNullable() | 11 | table.string('type', 80).notNullable(); |
13 | table.boolean('is_revoked').defaultTo(false) | 12 | table.boolean('is_revoked').defaultTo(false); |
14 | table.timestamps() | 13 | table.timestamps(); |
15 | }) | 14 | }); |
16 | } | 15 | } |
17 | 16 | ||
18 | down () { | 17 | down() { |
19 | this.drop('tokens') | 18 | this.drop('tokens'); |
20 | } | 19 | } |
21 | } | 20 | } |
22 | 21 | ||
23 | module.exports = TokensSchema | 22 | module.exports = TokensSchema; |