cache-sync-action.prisma 855 B

12345678910111213141516171819202122232425262728293031
  1. model CacheSyncAction {
  2. id BigInt @id @default(autoincrement()) @db.BigInt
  3. // e.g. 'AD', 'AD_POOL', 'CHANNEL', 'CATEGORY', 'VIDEO_LIST'
  4. entityType String @db.VarChar(50)
  5. // optional: when operation targets a specific entity
  6. entityId BigInt? @db.BigInt
  7. // e.g. 'REFRESH', 'INVALIDATE', 'REBUILD_POOL', 'REFRESH_ALL'
  8. operation String @db.VarChar(50)
  9. // 'PENDING' | 'SUCCESS' | 'FAILED' | 'GAVE_UP'
  10. status String @db.VarChar(20)
  11. attempts Int @default(0)
  12. // epoch millis as BigInt (your preference)
  13. nextAttemptAt BigInt? @db.BigInt
  14. lastError String? @db.VarChar(500)
  15. // for extra info, like { "type": "BANNER" }
  16. payload Json?
  17. createdAt BigInt @db.BigInt
  18. updatedAt BigInt @db.BigInt
  19. @@index([status, nextAttemptAt])
  20. @@index([entityType, entityId])
  21. }