/**
 * Migration: CreateJwtRevocationsTable
 * Creates a storage table for JWT token revocation (token invalidation).
 */
import { Schema as MigrationSchema } from '../../src/migrations/schema';
export const migration = {
    async up(db) {
        const schema = MigrationSchema.create(db);
        await schema.create('zintrust_jwt_revocations', (table) => {
            table.id();
            table.string('jti', 128).unique();
            table.string('sub', 191).nullable();
            table.bigInteger('expires_at_ms');
            table.timestamp('revoked_at').notNullable().default('CURRENT_TIMESTAMP');
            table.index(['expires_at_ms']);
        });
    },
    async down(db) {
        const schema = MigrationSchema.create(db);
        await schema.dropIfExists('zintrust_jwt_revocations');
    },
};
