/**
 * Migration: AddKindToJwtRevocationsTable
 * Adds a 'kind' column so the same table can distinguish revoked tokens vs active sessions.
 */
import { Schema as MigrationSchema } from '../../src/migrations/schema';
export const migration = {
    async up(db) {
        const schema = MigrationSchema.create(db);
        const hasKind = await schema.hasColumn('zintrust_jwt_revocations', 'kind');
        if (!hasKind) {
            await schema.table('zintrust_jwt_revocations', (table) => {
                table.string('kind', 16).notNullable().default('revoked');
                table.index(['kind']);
            });
        }
    },
    async down(_db) {
        // Note: dropping columns/FKs varies by driver; SQLite/D1 requires a table rebuild.
    },
};
