Description

A container holding subscriber IDs and their counters for a specific segment on a particular channel. This model acts as a single entity that represents an actual segment state, which saves us from having to query and process it every time we need it.

class SubscribersSegmentChannel(models.Model):
    segment = models.ForeignKey(SubscribersSegment, on_delete=models.CASCADE, null=False, related_name='channels')
    channel_id = models.BigIntegerField(db_index=True, null=False)
    subscribers = models.BigIntegerField(null=True)
    subscriber_ids_raw = models.TextField(null=True)
    push_services_counter_json = models.TextField(null=True)