"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.up = up;
exports.down = down;
const kysely_1 = require("kysely");
async function up(db) {
    await (0, kysely_1.sql) `ALTER TABLE "api_key" ALTER COLUMN "key" TYPE bytea USING decode("key", 'base64');`.execute(db);
    await (0, kysely_1.sql) `ALTER TABLE "session" ALTER COLUMN "token" TYPE bytea USING decode("token", 'base64');`.execute(db);
    await (0, kysely_1.sql) `CREATE INDEX "api_key_key_idx" ON "api_key" ("key");`.execute(db);
    await (0, kysely_1.sql) `CREATE INDEX "session_token_idx" ON "session" ("token");`.execute(db);
}
async function down(db) {
    await (0, kysely_1.sql) `DROP INDEX "api_key_key_idx";`.execute(db);
    await (0, kysely_1.sql) `DROP INDEX "session_token_idx";`.execute(db);
    await (0, kysely_1.sql) `ALTER TABLE "api_key" ALTER COLUMN "key" TYPE character varying USING encode("key", 'base64');`.execute(db);
    await (0, kysely_1.sql) `ALTER TABLE "session" ALTER COLUMN "token" TYPE character varying USING encode("token", 'base64');`.execute(db);
}
//# sourceMappingURL=1771873044511-ChangesTokensToBuffers.js.map