Edgewall Software

Trac Database Schema: Ticket System

Trac ticket system uses various database tables to store the tickets themselves, the change history and comments, and the various configurable ticket field enums etc.

Table ticket

TableKey
ticketid
ColumnsTypeDescription
idauto_incremente.g. 1 for ticket #1
type Can be joined with table enum field name where field type is ticket_type
timeint64Creation time
changetimeint64Time of last modification or comment
component Can be joined with table component field name
severity Can be joined with table enum field name where field type is severity
priority Can be joined with table enum field name where field type is priority
owner User name or email address of ticket owner
reporter User name or email address of ticket reporter
cc Comma separated list of email addresses to be CC'd notifications
version Can be joined with table version field name
milestone Can be joined with table milestone field name
status Ticket status e.g. new, assigned, closed
resolution Can be joined with table enum field name where field type is resolution
summary Short title-like summary
description Long description text
keywords Comma separated list of arbitrary keywords
Indexes
time
status

Stores the current core ticket fields. Additional custom ticket field values are stored in the ticket_custom table, while the ticket history and comments are stored in the ticket_change table.

Use the trac.ticket.model.Ticket model class to access any of these tables.

See trac.ticket.model.Ticket, TracDev/DataModels#Ticket

Table ticket_change

TableKey
ticket_changeticket, time, field
ColumnsTypeDescription
ticketintCan be joined with table ticket field id
timeint64Time of this change or comment (group to get all related entries)
author Author of this change or comment
field Name of the changed field
oldvalue Previous value of that field
newvalue New value of that field
Indexes
ticket
time

Stores ticket change history and comments.

The field value comment is special: it associates a comment with a set of field changes. oldvalue may store the comment number in that case as an optimization.

A comment's edit history is stored in field value _comment0, _comment1 etc. In these cases the newvalue stores the edit time.

Use the trac.ticket.model.Ticket model class to access this table.

See trac.ticket.model.Ticket

Table ticket_custom

TableKey
ticket_customticket, name
ColumnsTypeDescription
ticketintCan be joined with table ticket field id
name Custom ticket field name
value Current field value

Stores the current custom ticket field values.

Use the trac.ticket.model.Ticket model class to access this table.

See trac.ticket.model.Ticket, TracTicketsCustomFields

Table enum

TableKey
enumtype, name
ColumnsTypeDescription
type resolution, priority, ticket_type or severity
name Name of the enum value
value Ordering value

Stores the different values for the various ticket enum fields.

Use the trac.ticket.model.AbstractEnum model subclasses to access this table:

  • trac.ticket.model.Type
  • trac.ticket.model.Resolution
  • trac.ticket.model.Priority
  • trac.ticket.model.Severity

Trac initializes this table during installation with various default ticket types, resolutions and priorities.

See trac.ticket.model

Table component

TableKey
componentname
ColumnsDescription
nameTicket component name
ownerUser name of component owner
descriptionComponent description

Stores the available TicketComponent entries.

Use the trac.ticket.model.Component model class to access this table.

Trac initializes this table during installation with some dummy components.

See trac.ticket.model.Component, TicketComponent

Table milestone

TableKey
milestonename
ColumnsTypeDescription
name Name of the milestone
dueint64Due date
completedint64Date of completion
description Description wiki content

Stores the available milestones.

Use the trac.ticket.model.Milestone model class to access this table.

Trac initializes this table during installation with some dummy milestones.

See trac.ticket.model.Milestone

Table version

TableKey
versionname
ColumnsTypeDescription
name Name of the version
time Release date of the version
description Description wiki content

Stores the available versions.

Use the trac.ticket.model.Version model class to access this table.

Trac initializes this table during installation with some dummy versions.

See trac.ticket.model.Version

Last modified 8 years ago Last modified on Jul 17, 2016, 1:02:31 AM
Note: See TracWiki for help on using the wiki.