[[PageOutline(2-5,Contents,pullout)]] = Trac Database Schema The database schema is defined in [source:/trunk/trac/db_default.py trac.db_default], along with the initial contents of the database. The schema includes the tables listed below. == Overview * [./Common] * [./Attachments] * [./WikiSystem Wiki System] * [./VersionControl Version control system] * [./TicketSystem Ticket system] * [./ReportSystem Report system] * [./NotificationSystem Notification system] || '''Table Name''' || '''Purpose''' || || [./Attachments#Tableattachment attachment] || Descriptions of attachments, the files themselves are stored on disk. || || [./Common#Tableauth_cookie auth_cookie] || User login cookies. || || [./Common#Tablecache cache] || Synchronization table for process- and thread-local caches. || || [./TicketSystem#Tablecomponent 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. || || [./TicketSystem#Tableenum enum] || Maps integer IDs for issues' priorities, severities, etc. to human-readable names. || || [./TicketSystem#Tablemilestone milestone] || Project milestones. || || [./VersionControl#Tablenode_change node_change] || First half of the repository cache: for every changeset (as identified by the revision number), this table contains the nodes (files or directories) that have been added, modified or deleted. || ||[./NotificationSystem#Tablenotify_subscription notify_subscription] || User preferences for notification subscriptions. || ||[./NotificationSystem#Tablenotify_watch notify_watch] || User preferences for notification watches. || || [./Common#Tablepermission permission] || Username/action pairs describing who is allowed to do what. This table's contents also hold permission groups. || || [./ReportSystem#Tablereport report] || Stores the SQL to generate canned database reports. || || [./VersionControl#Tablerepository repository] || Stores cached and configured repository properties. || || [./VersionControl#Tablerevision revision] || Second 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. || || [./Common#Tablesession session] || Last user visit time. || || [./Common#Tablesession_attribute session_attribute] || Information about user settings, including name, email, and diff options. || || [./Common#Tablesystem system] || System information such as the database version and repository cache metadata. || || [./TicketSystem#Tableticket ticket] || Tickets. || || [./TicketSystem#Tableticket_change 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. || || [./TicketSystem#Tableticket_custom ticket_custom] || The values of custom ticket fields. || || [./TicketSystem#Tableversion 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. || || [./WikiSystem#Tablewiki wiki] || Wiki pages, including old revisions. || == Database Schema Trac 0.11 [[Image(trac-schema-v2.png)]] 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 and Trac 0.11 is no longer supported. == Database Schema Trac 0.12 [[Image(db_trac_eng_final.png)]] This schema is not reviewed or validated by Trac developers. ---- See also: TracDev, TracDev/DatabaseUpgrades