diff options
author | MCMXC <16797721+mcmxcdev@users.noreply.github.com> | 2024-02-10 18:19:14 -0700 |
---|---|---|
committer | MCMXC <16797721+mcmxcdev@users.noreply.github.com> | 2024-02-10 18:19:14 -0700 |
commit | 0300c85c15088e3ff2756b344a0adbd3ca235fd3 (patch) | |
tree | 7828ae930c77ff18139076832ead32d03c6385e7 /database/migrations/1503250034280_token.ts | |
parent | Update submodules [skip ci] (diff) | |
download | ferdium-server-0300c85c15088e3ff2756b344a0adbd3ca235fd3.tar.gz ferdium-server-0300c85c15088e3ff2756b344a0adbd3ca235fd3.tar.zst ferdium-server-0300c85c15088e3ff2756b344a0adbd3ca235fd3.zip |
refactor: project maintenance
- work in progress
Diffstat (limited to 'database/migrations/1503250034280_token.ts')
-rw-r--r-- | database/migrations/1503250034280_token.ts | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/database/migrations/1503250034280_token.ts b/database/migrations/1503250034280_token.ts index 5a030d0..3830c98 100644 --- a/database/migrations/1503250034280_token.ts +++ b/database/migrations/1503250034280_token.ts | |||
@@ -1,20 +1,20 @@ | |||
1 | import BaseSchema from '@ioc:Adonis/Lucid/Schema'; | 1 | import { BaseSchema } from '@adonisjs/lucid/schema' |
2 | 2 | ||
3 | export default class extends BaseSchema { | 3 | export default class extends BaseSchema { |
4 | protected tableName = 'tokens'; | 4 | protected tableName = 'tokens' |
5 | 5 | ||
6 | public async up(): Promise<void> { | 6 | public async up(): Promise<void> { |
7 | this.schema.createTable(this.tableName, table => { | 7 | this.schema.createTable(this.tableName, (table) => { |
8 | table.increments(); | 8 | table.increments() |
9 | table.integer('user_id').unsigned().references('users.id'); | 9 | table.integer('user_id').unsigned().references('users.id') |
10 | table.string('token', 255).notNullable().unique().index(); | 10 | table.string('token', 255).notNullable().unique().index() |
11 | table.string('type', 80).notNullable(); | 11 | table.string('type', 80).notNullable() |
12 | table.boolean('is_revoked').defaultTo(false); | 12 | table.boolean('is_revoked').defaultTo(false) |
13 | table.timestamps(); | 13 | table.timestamps() |
14 | }); | 14 | }) |
15 | } | 15 | } |
16 | 16 | ||
17 | public async down(): Promise<void> { | 17 | public async down(): Promise<void> { |
18 | this.schema.dropTable(this.tableName); | 18 | this.schema.dropTable(this.tableName) |
19 | } | 19 | } |
20 | } | 20 | } |