Edgewall Software

Trac Database Schema

The database schema is defined in trac.db_default, along with the initial contents of the database. The schema includes the tables listed below.

Overview

Table Name Purpose
attachment Descriptions of attachments (the files themselves are stored on disk).
auth_cookie User login cookies.
cache Synchronization table for process- and thread-local caches.
component Values that can be used in a ticket's "component" field. The owner column is used as the default assignee for new tickets, if not overridden at the time of ticket submission.
enum Maps integer IDs for issues' priorities, severities, etc. to human-readable names.
milestone Project milestones.
node_change 1st half of the repository cache: for every changeset (as identified by the revision number), this table contains the nodes (i.e. files or directories) that have been added/modified/deleted.
notify_subscription User preferences for notification subscriptions.
permission Username/action pairs describing who's allowed to do what. This table's contents also hold permission groups.
report Stores the SQL to generate canned database reports.
repository Stores cached and configured repository properties.
revision 2nd half of the repository cache: changesets, containing the revision number, author, time, and log message. The list of files and directories modified by a changeset can be found by joining with node_change on the rev column.
session Last user visit time.
session_attribute Information about user settings, including name, email, and diff options.
system System information such as the database version and repository cache metadata
ticket Tickets.
ticket_change Changes to tickets, on a field-by-field basis. The field value comment is special: it associates a comment with a set of field changes.
ticket_custom The values of custom ticket fields.
version As in component and milestone, this holds the options of the drop-down version list on the ticket form. Every version can have a time set, although that is not presently used other than for ordering the list of versions in the UI.
wiki Wiki pages (including old revisions).

Database Schema 0.11

Overview of Trac 0.10 and 0.11 database schema, kindly contributed by Johans Marvin Taboada Villca

Note that some of the pictured relations are not "true" relations in the traditional relational meaning. Also, there's no "real" user table. The particular cases are explained in the embedded notes.

This schema is incomplete, for Trac 0.12.

Database Schema 0.12

trac-schema-0.12

This schema is not reviewed and "validated" by trac devs


See also: TracDev, TracDev/DatabaseUpgrades

Last modified 12 days ago Last modified on Dec 8, 2014 7:40:41 PM

Attachments (3)

Download all attachments as: .zip