Skip to main content

tickets_progress_labels

Sub-status labels for finer workflow tracking on top of the closed tickets.status enum. One row per (ticket, label).

Source Mapping

CouchDB document type: a "ticket" document — rows are produced by asyncconvert.py's tickets_progress_labels(obj) handler iterating the ticket's progressLabels[] array.

ColumnCouchDB sourceNotes
progress_labelprogressLabels[i]One element of the ticket's progressLabels array, cast to a string. Free text.
ticketididThe tickets.id this row belongs to.
projectiddatabaseThe project this ticket belongs to.
couchdbidcouchDbIdLegacy CouchDB document identifier (the ticket's).

Column Reference

ColumnTypeNullableDescription
progress_labelVARCHAR(255)yesFree-text progress label / sub-status applied to the ticket.
ticketidVARCHAR(255)yesForeign-key reference to tickets.id.
projectidVARCHAR(255)yesThe project this ticket belongs to.
couchdbidVARCHAR(255)yesLegacy CouchDB identifier of the ticket document.

Keys

  • No primary key. Identity is the unique constraint uk_ticket_progress_label on (ticketid, progress_label).
  • Unique key: uk_ticket_progress_label on (ticketid, progress_label).

Indexes

  • idx_projectid on projectid
  • idx_ticket on ticketid

Relationships

DirectionOther tableJoinCardinality
outgoingticketstickets_progress_labels.ticketid = tickets.idmany rows → one ticket
outgoingprojectstickets_progress_labels.projectid = projects.idmany rows → one project

None of these are foreign-keyed in MariaDB; joins are by string match.

Refresh Semantics

tickets_progress_labels is rebuilt per ticket document. On each observation of a ticket, the converter:

  1. Issues DELETE FROM tickets_progress_labels WHERE ticketid = <ticket_id> (when delete tracking is enabled).
  2. Iterates the ticket's progressLabels[] array and emits one INSERT IGNORE per element.

Inserts are INSERT IGNORE against the (ticketid, progress_label) unique key.

A reindex with type=ticket (or a full reindex) rebuilds this table.

Common Queries

Progress labels on a ticket

SELECT progress_label
FROM tickets_progress_labels
WHERE ticketid = 'your_ticket_id'
ORDER BY progress_label;

Tickets carrying a specific progress label

SELECT
t.id,
t.title,
t.status
FROM tickets t
JOIN tickets_progress_labels tpl ON tpl.ticketid = t.id
WHERE tpl.progress_label = 'waiting on parts'
AND t.archived IS NULL
ORDER BY t.lastmodifieddate DESC;

Progress-label distribution

SELECT
progress_label,
COUNT(DISTINCT ticketid) AS tickets
FROM tickets_progress_labels
WHERE projectid = 'your_project_id'
GROUP BY progress_label
ORDER BY tickets DESC;

Pitfalls

  • Sub-status, not status. Progress labels coexist with the closed tickets.status enum and are independent of it. A started ticket can carry zero, one, or many progress labels.
  • progress_label is free text. Casing and spelling drift across users; group with LOWER(progress_label) if needed.
  • No primary key. Identity is (ticketid, progress_label). A ticket can carry multiple labels.
  • Reading during an in-flight reindex of a ticket may briefly return zero rows for that ticket.
  • No FK constraints. Joins to tickets.id are by string match.