diff --git a/src/db/DittoTables.ts b/src/db/DittoTables.ts index e56a062e..863ca61e 100644 --- a/src/db/DittoTables.ts +++ b/src/db/DittoTables.ts @@ -75,6 +75,6 @@ interface EventZapRow { receipt_id: string; target_event_id: string; sender_pubkey: string; - amount: number; + amount_millisats: number; comment: string; } diff --git a/src/db/migrations/027_add_zap_events.ts b/src/db/migrations/027_add_zap_events.ts index 058e6baf..fe2e1d20 100644 --- a/src/db/migrations/027_add_zap_events.ts +++ b/src/db/migrations/027_add_zap_events.ts @@ -3,11 +3,10 @@ import { Kysely } from 'kysely'; export async function up(db: Kysely): Promise { await db.schema .createTable('event_zaps') - .ifNotExists() .addColumn('receipt_id', 'text', (col) => col.primaryKey()) .addColumn('target_event_id', 'text', (col) => col.notNull()) .addColumn('sender_pubkey', 'text', (col) => col.notNull()) - .addColumn('amount', 'integer', (col) => col.notNull()) + .addColumn('amount_millisats', 'integer', (col) => col.notNull()) .addColumn('comment', 'text', (col) => col.notNull()) .execute(); @@ -21,6 +20,6 @@ export async function up(db: Kysely): Promise { } export async function down(db: Kysely): Promise { - await db.schema.dropIndex('idx_event_zaps_id_amount').execute(); + await db.schema.dropIndex('idx_event_zaps_id_amount').ifExists().execute(); await db.schema.dropTable('event_zaps').execute(); }