From 89b8948195f24df127b7ae656ab3f60bd1b49ac7 Mon Sep 17 00:00:00 2001 From: bndw Date: Fri, 13 Feb 2026 20:36:12 -0800 Subject: refactor: simplify deletion handling (remove NIP-09 processing) Remove deletion processing logic in favor of simpler approach: - Remove deletions table from schema - Delete deletions.go and deletions_test.go - Remove ProcessDeletion from EventStore interface - Kind 5 events now stored like any other event (no special handling) - Update storage test to expect 2 tables instead of 3 - All 41 tests passing --- internal/storage/storage.go | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'internal/storage/storage.go') diff --git a/internal/storage/storage.go b/internal/storage/storage.go index 806acac..d00d7bf 100644 --- a/internal/storage/storage.go +++ b/internal/storage/storage.go @@ -99,18 +99,6 @@ func (s *Storage) initSchema(ctx context.Context) error { ON events(tags) WHERE deleted = 0; - -- Deletion events (NIP-09) - CREATE TABLE IF NOT EXISTS deletions ( - deleted_event_id TEXT PRIMARY KEY, -- ID of event being deleted - deletion_event_id TEXT NOT NULL, -- ID of deletion event - pubkey TEXT NOT NULL, -- Who requested deletion - created_at INTEGER NOT NULL, - FOREIGN KEY (deleted_event_id) REFERENCES events(id) - ) STRICT; - - CREATE INDEX IF NOT EXISTS idx_deleted_event - ON deletions(deleted_event_id); - -- Replaceable events tracking (NIP-16, NIP-33) CREATE TABLE IF NOT EXISTS replaceable_events ( kind INTEGER NOT NULL, -- cgit v1.2.3