model CacheSyncAction { id BigInt @id @default(autoincrement()) @db.BigInt // e.g. 'AD', 'AD_POOL', 'CHANNEL', 'CATEGORY', 'VIDEO_LIST' entityType String @db.VarChar(50) // optional: when operation targets a specific entity entityId BigInt? @db.BigInt // e.g. 'REFRESH', 'INVALIDATE', 'REBUILD_POOL', 'REFRESH_ALL' operation String @db.VarChar(50) // 'PENDING' | 'SUCCESS' | 'FAILED' | 'GAVE_UP' status String @db.VarChar(20) attempts Int @default(0) // epoch millis as BigInt (your preference) nextAttemptAt BigInt? @db.BigInt lastError String? @db.VarChar(500) // for extra info, like { "type": "BANNER" } payload Json? createdAt BigInt @db.BigInt updatedAt BigInt @db.BigInt @@index([status, nextAttemptAt]) @@index([entityType, entityId]) }