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.
| Column | CouchDB source | Notes |
|---|---|---|
progress_label | progressLabels[i] | One element of the ticket's progressLabels array, cast to a string. Free text. |
ticketid | id | The tickets.id this row belongs to. |
projectid | database | The project this ticket belongs to. |
couchdbid | couchDbId | Legacy CouchDB document identifier (the ticket's). |
Column Reference
| Column | Type | Nullable | Description |
|---|---|---|---|
progress_label | VARCHAR(255) | yes | Free-text progress label / sub-status applied to the ticket. |
ticketid | VARCHAR(255) | yes | Foreign-key reference to tickets.id. |
projectid | VARCHAR(255) | yes | The project this ticket belongs to. |
couchdbid | VARCHAR(255) | yes | Legacy CouchDB identifier of the ticket document. |
Keys
- No primary key. Identity is the unique constraint
uk_ticket_progress_labelon (ticketid,progress_label). - Unique key:
uk_ticket_progress_labelon (ticketid,progress_label).
Indexes
idx_projectidonprojectididx_ticketonticketid
Relationships
| Direction | Other table | Join | Cardinality |
|---|---|---|---|
| outgoing | tickets | tickets_progress_labels.ticketid = tickets.id | many rows → one ticket |
| outgoing | projects | tickets_progress_labels.projectid = projects.id | many 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:
- Issues
DELETE FROM tickets_progress_labels WHERE ticketid = <ticket_id>(when delete tracking is enabled). - Iterates the ticket's
progressLabels[]array and emits oneINSERT IGNOREper 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.statusenum and are independent of it. Astartedticket can carry zero, one, or many progress labels. progress_labelis free text. Casing and spelling drift across users; group withLOWER(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.idare by string match.