| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- model AdsHourlyStats {
- id String @id @map("_id") @default(auto()) @db.ObjectId
- adsId String @db.ObjectId
- // Hour bucket start time (epoch seconds, GMT+8 aligned in code)
- hourStartAt BigInt
- clicks BigInt @default(0)
- createAt BigInt
- updateAt BigInt
- @@index([hourStartAt])
- @@unique([adsId, hourStartAt])
- @@map("adsHourlyStats")
- }
- model AdsDailyStats {
- id String @id @map("_id") @default(auto()) @db.ObjectId
- adsId String @db.ObjectId
- // Day bucket start time (epoch seconds, GMT+8 aligned in code)
- dayStartAt BigInt
- clicks BigInt @default(0)
- createAt BigInt
- updateAt BigInt
- @@index([dayStartAt])
- @@unique([adsId, dayStartAt])
- @@map("adsDailyStats")
- }
- model ChannelHourlyUserStats {
- id String @id @map("_id") @default(auto()) @db.ObjectId
- channelId String
- // Hour bucket start time (epoch seconds, GMT+8 aligned in code)
- hourStartAt BigInt
- // Total events in this hour (e.g. login count)
- total BigInt @default(0)
- // Unique user count (dedup by uid during aggregation)
- uniqueUsers BigInt @default(0)
- createAt BigInt
- updateAt BigInt
- @@index([hourStartAt])
- @@unique([channelId, hourStartAt])
- @@map("channelHourlyUserStats")
- }
- model ChannelDailyUserStats {
- id String @id @map("_id") @default(auto()) @db.ObjectId
- channelId String
- // Day bucket start time (epoch seconds, GMT+8 aligned in code)
- dayStartAt BigInt
- total BigInt @default(0)
- uniqueUsers BigInt @default(0)
- createAt BigInt
- updateAt BigInt
- @@index([dayStartAt])
- @@unique([channelId, dayStartAt])
- @@map("channelDailyUserStats")
- }
|