diff --git a/prisma/migrations/20260622000000_add_topic_fetch_enabled/migration.sql b/prisma/migrations/20260622000000_add_topic_fetch_enabled/migration.sql new file mode 100644 index 0000000..82a8b9c --- /dev/null +++ b/prisma/migrations/20260622000000_add_topic_fetch_enabled/migration.sql @@ -0,0 +1,5 @@ +-- AlterTable: per-topic user-controlled fetch toggle (forum channels) +-- Additive, safe default (true) so existing rows backfill to "enabled" and +-- current behaviour is unchanged. Disabling is non-destructive. +ALTER TABLE "topic_progress" + ADD COLUMN "fetchEnabled" BOOLEAN NOT NULL DEFAULT true; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 4988f8e..2e26e8d 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -597,6 +597,11 @@ model TopicProgress { accountChannelMapId String topicId BigInt topicName String? + /// User-controlled fetch toggle. When false, the worker skips this topic + /// (no scanning, no fetching/transfer). Defaults true so every existing and + /// newly-discovered topic is fetched unless explicitly disabled. Disabling + /// is non-destructive — already-fetched packages are kept. + fetchEnabled Boolean @default(true) lastProcessedMessageId BigInt? /// When this topic was last scanned (any reason). Used by recency-skip. lastScannedAt DateTime?