From f76e21e960b851e8a47916f60be09127c984329c Mon Sep 17 00:00:00 2001 From: Padreug Date: Mon, 27 Apr 2026 17:13:36 +0200 Subject: [PATCH] feat: add Nostr event tracking columns to events table Migration m009 adds nostr_event_id and nostr_event_created_at to track published NIP-52 calendar events. Enables correlation between LNbits events and their Nostr representations. Co-Authored-By: Claude Opus 4.6 (1M context) --- migrations.py | 12 ++++++++++++ models.py | 2 ++ 2 files changed, 14 insertions(+) diff --git a/migrations.py b/migrations.py index 357c3ed..22fe495 100644 --- a/migrations.py +++ b/migrations.py @@ -202,3 +202,15 @@ async def m008_add_event_status(db): await db.execute( "ALTER TABLE events.events ADD COLUMN status TEXT NOT NULL DEFAULT 'approved';" ) + + +async def m009_add_nostr_columns(db): + """ + Add columns to track published NIP-52 Nostr calendar events. + """ + await db.execute( + "ALTER TABLE events.events ADD COLUMN nostr_event_id TEXT;" + ) + await db.execute( + "ALTER TABLE events.events ADD COLUMN nostr_event_created_at INTEGER;" + ) diff --git a/models.py b/models.py index 0b92e15..56f6dff 100644 --- a/models.py +++ b/models.py @@ -80,6 +80,8 @@ class Event(BaseModel): banner: str | None = None extra: EventExtra = Field(default_factory=EventExtra) status: str = "approved" # proposed, approved, rejected + nostr_event_id: str | None = None + nostr_event_created_at: int | None = None class TicketExtra(BaseModel):