mirror of
https://github.com/xCyanGrizzly/DragonsStash.git
synced 2026-05-10 22:01:16 +00:00
feat: add SkippedPackage model for tracking skipped/failed archives
Adds SkipReason enum (SIZE_LIMIT, DOWNLOAD_FAILED, EXTRACT_FAILED, UPLOAD_FAILED) and SkippedPackage model with unique constraint on (sourceChannelId, sourceMessageId). Reverse relations added to TelegramAccount and TelegramChannel. Note: Run `npx prisma migrate dev --name add-skipped-packages` when database is available to create the migration. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -409,9 +409,10 @@ model TelegramAccount {
|
|||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
|
|
||||||
channelMaps AccountChannelMap[]
|
channelMaps AccountChannelMap[]
|
||||||
ingestionRuns IngestionRun[]
|
ingestionRuns IngestionRun[]
|
||||||
fetchRequests ChannelFetchRequest[]
|
fetchRequests ChannelFetchRequest[]
|
||||||
|
skippedPackages SkippedPackage[]
|
||||||
|
|
||||||
@@index([isActive])
|
@@index([isActive])
|
||||||
@@map("telegram_accounts")
|
@@map("telegram_accounts")
|
||||||
@@ -428,8 +429,9 @@ model TelegramChannel {
|
|||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
|
|
||||||
accountMaps AccountChannelMap[]
|
accountMaps AccountChannelMap[]
|
||||||
packages Package[]
|
packages Package[]
|
||||||
|
skippedPackages SkippedPackage[]
|
||||||
|
|
||||||
@@index([type, isActive])
|
@@index([type, isActive])
|
||||||
@@index([category])
|
@@index([category])
|
||||||
@@ -686,6 +688,39 @@ model ArchiveExtractRequest {
|
|||||||
@@map("archive_extract_requests")
|
@@map("archive_extract_requests")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ───────────────────────────────────────
|
||||||
|
// Skipped/Failed Archives
|
||||||
|
// ───────────────────────────────────────
|
||||||
|
|
||||||
|
enum SkipReason {
|
||||||
|
SIZE_LIMIT
|
||||||
|
DOWNLOAD_FAILED
|
||||||
|
EXTRACT_FAILED
|
||||||
|
UPLOAD_FAILED
|
||||||
|
}
|
||||||
|
|
||||||
|
model SkippedPackage {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
fileName String
|
||||||
|
fileSize BigInt
|
||||||
|
reason SkipReason
|
||||||
|
errorMessage String?
|
||||||
|
sourceChannelId String
|
||||||
|
sourceChannel TelegramChannel @relation(fields: [sourceChannelId], references: [id], onDelete: Cascade)
|
||||||
|
sourceMessageId BigInt
|
||||||
|
sourceTopicId BigInt?
|
||||||
|
isMultipart Boolean @default(false)
|
||||||
|
partCount Int @default(1)
|
||||||
|
accountId String
|
||||||
|
account TelegramAccount @relation(fields: [accountId], references: [id], onDelete: Cascade)
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
|
||||||
|
@@unique([sourceChannelId, sourceMessageId])
|
||||||
|
@@index([reason])
|
||||||
|
@@index([accountId])
|
||||||
|
@@map("skipped_packages")
|
||||||
|
}
|
||||||
|
|
||||||
// ───────────────────────────────────────
|
// ───────────────────────────────────────
|
||||||
// Purchased Kickstarters
|
// Purchased Kickstarters
|
||||||
// ───────────────────────────────────────
|
// ───────────────────────────────────────
|
||||||
|
|||||||
Reference in New Issue
Block a user