@@ -123,6 +123,7 @@ class WorkflowTriggerTable(Base):
123123
124124    __table_args__  =  (
125125        PrimaryKeyConstraint ('id' , 'tenant' , 'production' ),
126+         Index ('idx_collector' , 'event_type_id' , 'source_id' , 'enabled' , 'tenant' , 'production' ),
126127    )
127128
128129    running : bool  =  False 
@@ -237,6 +238,8 @@ class DestinationTable(Base):
237238
238239    __table_args__  =  (
239240        PrimaryKeyConstraint ('id' , 'tenant' , 'production' ),
241+         Index ('idx_collector' , 'event_type_id' , 'source_id' , 'enabled' , 'tenant' , 'production' ),
242+ 
240243    )
241244
242245    running : bool  =  False 
@@ -298,6 +301,7 @@ class IdentificationPointTable(Base):
298301
299302    __table_args__  =  (
300303        PrimaryKeyConstraint ('id' , 'tenant' , 'production' ),
304+         Index ('idx_collector' , 'tenant' , 'production' , 'enabled' , 'event_type_id' , 'source_id' )
301305    )
302306
303307    running : bool  =  False 
@@ -335,6 +339,7 @@ class EventRedirectTable(Base):
335339
336340    __table_args__  =  (
337341        PrimaryKeyConstraint ('id' , 'tenant' , 'production' ),
342+         Index ('idx_collector' , 'event_type' , 'source_id' , 'tenant' , 'production' ),
338343    )
339344
340345    running : bool  =  False 
@@ -356,6 +361,7 @@ class EventValidationTable(Base):
356361
357362    __table_args__  =  (
358363        PrimaryKeyConstraint ('id' , 'tenant' , 'production' ),
364+         Index ('idx_collector' , 'event_type' , 'enabled' , 'tenant' , 'production' ),
359365    )
360366
361367    running : bool  =  False 
@@ -402,6 +408,7 @@ class EventReshapingTable(Base):
402408
403409    __table_args__  =  (
404410        PrimaryKeyConstraint ('id' , 'tenant' , 'production' ),
411+         Index ('idx_collector' , 'event_type' , 'tenant' , 'production' , 'enabled' )
405412    )
406413
407414    running : bool  =  False 
@@ -425,7 +432,8 @@ class EventMappingTable(Base):
425432
426433    __table_args__  =  (
427434        PrimaryKeyConstraint ('id' , 'tenant' , 'production' ),
428-         UniqueConstraint ('event_type' , name = 'uiq_event_type' )
435+         UniqueConstraint ('event_type' , name = 'uiq_event_type' ),
436+         Index ('idx_collector' , 'event_type' , 'tenant' , 'production' , 'enabled' )
429437    )
430438
431439    running : bool  =  False 
@@ -496,6 +504,7 @@ class EventToProfileMappingTable(Base):
496504
497505    __table_args__  =  (
498506        PrimaryKeyConstraint ('id' , 'tenant' , 'production' ),
507+         Index ('idx_collector' , 'event_type_id' , 'tenant' , 'production' , 'enabled' )
499508    )
500509
501510    running : bool  =  False 
@@ -517,6 +526,7 @@ class EventDataComplianceTable(Base):
517526
518527    __table_args__  =  (
519528        PrimaryKeyConstraint ('id' , 'tenant' , 'production' ),
529+         Index ('idx_collector' , 'event_type_id' , 'tenant' , 'production' , 'enabled' )
520530    )
521531
522532    running : bool  =  False 
@@ -546,27 +556,6 @@ class ActivationTable(Base):
546556    running : bool  =  False 
547557
548558
549- # class SegmentTable(Base): 
550- #     __tablename__ = 'segment' 
551- # 
552- #     id = Column(String(40)) 
553- #     name = Column(Text) 
554- #     description = Column(Text) 
555- #     event_type = Column(String(64), default=None) 
556- #     condition = Column(Text) 
557- #     enabled = Column(Boolean, default=False) 
558- #     machine_name = Column(String(128)) 
559- # 
560- #     tenant = Column(String(40)) 
561- #     production = Column(Boolean) 
562- # 
563- #     __table_args__ = ( 
564- #         PrimaryKeyConstraint('id', 'tenant', 'production'), 
565- #     ) 
566- # 
567- #     running: bool = False 
568- 
569- 
570559class  ReportTable (Base ):
571560    __tablename__  =  'report' 
572561
@@ -587,31 +576,7 @@ class ReportTable(Base):
587576
588577    running : bool  =  False 
589578
590- 
591- # class ContentTable(Base): 
592- #     __tablename__ = 'content' 
593- # 
594- #     id = Column(String(48)) 
595- #     profile_id = Column(String(40)) 
596- #     timestamp = Column(DateTime) 
597- #     type = Column(String(64)) 
598- #     url = Column(String(255)) 
599- #     source = Column(String(128)) 
600- #     author = Column(String(96)) 
601- #     copyright = Column(String(128)) 
602- #     content = Column(BLOB) 
603- #     text = Column(Text) 
604- #     properties = Column(JSON) 
605- #     traits = Column(JSON) 
606- # 
607- #     tenant = Column(String(40)) 
608- #     production = Column(Boolean) 
609- # 
610- #     __table_args__ = ( 
611- #         PrimaryKeyConstraint('id', 'tenant', 'production'), 
612- #     ) 
613- 
614- 
579+ # TODO probably not used 
615580class  ImportTable (Base ):
616581    __tablename__  =  'import' 
617582
@@ -637,32 +602,6 @@ class ImportTable(Base):
637602    running : bool  =  False 
638603
639604
640- # class WorkflowSegmentationTriggerTable(Base): 
641- #     __tablename__ = 'workflow_segmentation_trigger' 
642- # 
643- #     id = Column(String(40)) 
644- #     timestamp = Column(DateTime) 
645- #     name = Column(String(128)) 
646- #     description = Column(Text) 
647- #     enabled = Column(Boolean, default=False) 
648- #     type = Column(String(32)) 
649- #     condition = Column(String(255)) 
650- #     operation = Column(String(32)) 
651- #     segment = Column(String(128)) 
652- #     code = Column(Text) 
653- #     workflow_id = Column(String(40)) 
654- #     workflow_name = Column(String(128)) 
655- # 
656- #     tenant = Column(String(40)) 
657- #     production = Column(Boolean) 
658- # 
659- #     __table_args__ = ( 
660- #         PrimaryKeyConstraint('id', 'tenant', 'production'), 
661- #     ) 
662- # 
663- #     running: bool = False 
664- 
665- 
666605class  TaskTable (Base ):
667606    __tablename__  =  'task' 
668607
@@ -681,6 +620,7 @@ class TaskTable(Base):
681620
682621    __table_args__  =  (
683622        PrimaryKeyConstraint ('id' , 'tenant' , 'production' ),
623+         Index ('idx_gui' , 'type' , 'tenant' , 'production' )
684624    )
685625
686626    running : bool  =  False 
0 commit comments