some updates to db indexes w/ burnettk

This commit is contained in:
jasquat 2023-03-17 16:15:09 -04:00
parent 2f60077b82
commit bc00f91570
4 changed files with 8 additions and 7 deletions

View File

@ -30,7 +30,7 @@ class MessageInstanceCorrelationRuleModel(SpiffworkflowBaseDBModel):
id = db.Column(db.Integer, primary_key=True)
message_instance_id = db.Column(ForeignKey(MessageInstanceModel.id), nullable=False, index=True) # type: ignore
name: str = db.Column(db.String(50), nullable=False)
name: str = db.Column(db.String(50), nullable=False, index=True)
retrieval_expression: str = db.Column(db.String(255))
updated_at_in_seconds: int = db.Column(db.Integer)
created_at_in_seconds: int = db.Column(db.Integer)

View File

@ -61,7 +61,7 @@ class ProcessInstanceModel(SpiffworkflowBaseDBModel):
process_initiator = relationship("UserModel")
bpmn_process_definition_id: int | None = db.Column(
ForeignKey(BpmnProcessDefinitionModel.id), nullable=True # type: ignore
ForeignKey(BpmnProcessDefinitionModel.id), nullable=True, index=True # type: ignore
)
bpmn_process_definition = relationship(BpmnProcessDefinitionModel)
bpmn_process_id: int | None = db.Column(ForeignKey(BpmnProcessModel.id), nullable=True) # type: ignore
@ -90,7 +90,7 @@ class ProcessInstanceModel(SpiffworkflowBaseDBModel):
) # type: ignore
bpmn_json: str | None = deferred(db.Column(db.JSON)) # type: ignore
start_in_seconds: int | None = db.Column(db.Integer)
start_in_seconds: int | None = db.Column(db.Integer, index=True)
end_in_seconds: int | None = db.Column(db.Integer)
updated_at_in_seconds: int = db.Column(db.Integer)
created_at_in_seconds: int = db.Column(db.Integer)

View File

@ -29,9 +29,9 @@ class TaskDefinitionModel(SpiffworkflowBaseDBModel):
bpmn_identifier: str = db.Column(db.String(255), nullable=False, index=True)
bpmn_name: str = db.Column(db.String(255), nullable=True, index=True)
typename: str = db.Column(db.String(255), nullable=False, index=True)
properties_json: dict = db.Column(db.JSON, nullable=False)
typename: str = db.Column(db.String(255), nullable=False)
updated_at_in_seconds: int = db.Column(db.Integer)
created_at_in_seconds: int = db.Column(db.Integer)

View File

@ -28,11 +28,12 @@ class UserModel(SpiffworkflowBaseDBModel):
id: int = db.Column(db.Integer, primary_key=True)
username: str = db.Column(db.String(255), nullable=False, unique=True)
email = db.Column(db.String(255), index=True)
service = db.Column(db.String(255), nullable=False, unique=False, index=True) # not 'openid' -- google, aws
service_id = db.Column(db.String(255), nullable=False, unique=False, index=True)
service = db.Column(db.String(255), nullable=False, unique=False) # not 'openid' -- google, aws
service_id = db.Column(db.String(255), nullable=False, unique=False)
display_name = db.Column(db.String(255))
email = db.Column(db.String(255))
tenant_specific_field_1: str | None = db.Column(db.String(255))
tenant_specific_field_2: str | None = db.Column(db.String(255))
tenant_specific_field_3: str | None = db.Column(db.String(255))