From ff361a410662ae11993e915493d3a60a698d0378 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 2 Oct 2024 18:34:19 -0500 Subject: [PATCH] Recreate nip46_tokens in down migration --- src/db/migrations/037_auth_tokens.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/db/migrations/037_auth_tokens.ts b/src/db/migrations/037_auth_tokens.ts index 9df133f5..71e971d3 100644 --- a/src/db/migrations/037_auth_tokens.ts +++ b/src/db/migrations/037_auth_tokens.ts @@ -49,4 +49,14 @@ export async function up(db: Kysely): Promise { export async function down(db: Kysely): Promise { await db.schema.dropTable('auth_tokens').execute(); + + await db.schema + .createTable('nip46_tokens') + .addColumn('api_token', 'text', (col) => col.primaryKey().unique().notNull()) + .addColumn('user_pubkey', 'text', (col) => col.notNull()) + .addColumn('server_seckey', 'bytea', (col) => col.notNull()) + .addColumn('server_pubkey', 'text', (col) => col.notNull()) + .addColumn('relays', 'text', (col) => col.defaultTo('[]')) + .addColumn('connected_at', 'timestamp', (col) => col.defaultTo(sql`CURRENT_TIMESTAMP`)) + .execute(); }