import { BaseSchema } from '@adonisjs/lucid/schema' export default class extends BaseSchema { protected tableName = 'tokens' public async up(): Promise { this.schema.createTable(this.tableName, (table) => { table.increments() table.integer('user_id').unsigned().references('users.id') table.string('token', 255).notNullable().unique().index() table.string('type', 80).notNullable() table.boolean('is_revoked').defaultTo(false) table.timestamps() }) } public async down(): Promise { this.schema.dropTable(this.tableName) } }