3.3. Database Schema

Table 3-1. Schema for table attachment

FieldTypeKeyDescription
attachment_idint(10) unsignedPrimary 
bug_idint(10) unsignedForeign 
file_namechar(255) The name of the file supplied by the user and the name as it is stored on disk.
descriptionchar(255) The description of the file as entered by the user.
file_sizebigint(20) unsigned  
mime_typechar(30) The MIME type as obtained by PHP when the file was uploaded
created_byint(10) unsigned  
created_datebigint(20) unsigned  

Table 3-2. Schema for table auth_group

FieldTypeKeyDescription
group_idint(10) unsignedPrimary 
group_namevarchar(80)  
lockedtinyint(1) Accepts values 1 or 0 for whether or not a group can be edited from the admin tools.
created_byint(10) unsigned  
created_datebigint(20) unsigned  
last_modified_byint(10) unsigned  
last_modified_datebigint(20) unsigned  

This table defines the various groups to which a user may belong. The initial groups are Admin, User, and Developer.

Table 3-3. Schema for table auth_perm

FieldTypeKeyDescription
perm_idint(10) unsignedPrimary 
perm_namevarchar(80)  
created_byint(10) unsigned  
created_datebigint(20) unsigned  
last_modified_byint(10) unsigned  
last_modified_datebigint(20) unsigned  

auth_perm stores the various permissions that can be assigned to users.

Table 3-4. Schema for table auth_user

FieldTypeKeyDescription
user_idint(10) unsignedPrimary 
loginchar(40)Unique 
first_namechar(40)  
last_namechar(40)  
emailchar(60)  
passwordchar(40)  
activetinyint(3) unsigned  
bug_list_fieldschar(255) This contains a serialized array of the fields the user has selected to see in the bug list. If this field is empty the default fields will be shown.
created_byint(10) unsigned  
created_datebigint(20) unsigned  
last_modified_byint(10) unsigned  
last_modified_datebigint(20) unsigned  

Table 3-5. Schema for table bug

FieldTypeKeyDescription
bug_idint(10) unsignedPrimary 
titlevarchar(100) The short summary.
descriptiontext The longer, more detailed description of a bug.
urlvarchar(255)  
severity_idtinyint(3) unsignedForeign 
prioritytinyint(3) unsigned  
status_idtinyint(3) unsignedForeign 
resolution_idtinyint(3) unsignedForeign 
assigned_toint(10) unsigned The user_id of the user to whom the bug is assigned.
created_byint(10) unsigned The user_id of the user who reported the bug.
created_datebigint(20) unsigned  
last_modified_byint(10) unsigned  
last_modified_datebigint(20) unsigned  
project_idint(10) unsignedForeign 
version_idint(10) unsignedForeign 
component_idint(10) unsignedForeign 
os_idtinyint(3) unsignedForeign 
browser_stringvarchar(255) The value obtained from $HTTP_USER_AGENT.
close_datebigint(20) unsigned  

Table 3-6. Schema for table bug_cc

FieldTypeKeyDescription
bug_idint(10) unsignedForeign 
user_idint(10) unsignedForeignThe user to whom to send carbon copies of the emails sent due to changes in the bug status.
created_byint(10) unsigned  
created_datebigint(20) unsigned  

Table 3-7. Schema for table bug_dependency

FieldTypeKeyDescription
bug_idint(10) unsignedPrimary 
depends_onint(10) unsignedPrimary 

Table 3-8. Schema for table bug_group

FieldTypeKeyDescription
bug_idint(10) unsignedPrimary 
group_idint(10) unsignedPrimary 

This table isn't currently used.

Table 3-9. Schema for table bug_vote

FieldTypeKeyDescription
user_idint(10) unsignedPrimary 
bug_idint(10) unsignedPrimary 
created_datebigint(20) unsigned  

Table 3-10. Schema for table bug_history

FieldTypeKeyDescription
bug_idint(10) unsignedForeign 
changed_fieldchar(20) The field, such as version, component, etc., that changed.
old_valuechar(255)  
new_valuechar(255)  
created_byint(10) unsigned  
created_datebigint(20) unsigned  

Table 3-11. Schema for table comment

FieldTypeKeyDescription
comment_idint(10) unsignedPrimary 
bug_idint(10) unsignedForeign 
comment_texttext  
created_byint(10) unsigned  
created_datebigint(20) unsigned  

Table 3-12. Schema for table component

FieldTypeKeyDescription
component_idint(10) unsignedPrimary 
project_idint(10) unsignedForeign 
component_namevarchar(30)  
component_desctext  
ownerint(10) unsigned This is the user_id of the developer who should receive initial email notifications of bugs created for this component.
activetinyint(1)  
created_byint(10) unsigned  
created_datebigint(20) unsigned  
last_modified_byint(10) unsigned  
last_modified_datebigint(20) unsigned  

Table 3-13. Schema for table configuration

FieldTypeKeyDescription
varnamechar(40)Primary 
varvaluechar(255)  
descriptionchar(255)  
vartypechar(20)  

This table stores the configuration for phpBugTracker

Table 3-14. Schema for table group_perm

FieldTypeKeyDescription
group_idint(10) unsignedPrimary 
perm_idint(10) unsignedPrimary 

Table 3-15. Schema for table os

FieldTypeKeyDescription
os_idint(10) unsignedPrimary 
os_namechar(30)  
sort_ordertinyint(3) unsigned  
regexchar(40)  

Table 3-16. Schema for table project

FieldTypeKeyDescription
project_idint(10) unsignedPrimary 
project_namevarchar(30)  
project_desctext  
activetinyint(1)  
created_byint(10) unsigned  
created_datebigint(20) unsigned  
last_modified_byint(10) unsigned  
last_modified_datebigint(20) unsigned  

Table 3-17. Schema for table project_group

FieldTypeKeyDescription
project_idint(10) unsignedPrimary 
group_idint(10) unsignedPrimary 
created_byint(10) unsigned  
created_datebigint(20) unsigned  

Table 3-18. Schema for table resolution

FieldTypeKeyDescription
resolution_idint(10) unsignedPrimary 
resolution_namevarchar(30)  
resolution_desctext  
sort_ordertinyint(3) unsigned  

Table 3-19. Schema for table saved_query

FieldTypeKeyDescription
saved_query_idint(10) unsignedPrimary 
user_idint(10) unsignedPrimary 
saved_query_namevarchar(40)  
saved_query_stringtext  

The saved_query table stores the queries saved by the users from the query page.

Table 3-20. Schema for table severity

FieldTypeKeyDescription
severity_idint(10) unsignedPrimary 
severity_namevarchar(30)  
severity_desctext  
sort_ordertinyint(3) unsigned  
severity_colorvarchar(10) The background color displayed for a row in the bug list if the USE_SEVERITY_COLOR configuration option is enabled.

Table 3-21. Schema for table status

FieldTypeKeyDescription
status_idint(10) unsignedPrimary 
status_namevarchar(30)  
status_desctext  
sort_ordertinyint(3) unsigned  

Table 3-22. Schema for table user_group

FieldTypeKeyDescription
user_idint(10) unsignedPrimary 
group_idint(10) unsignedPrimary 
created_byint(10) unsigned  
created_datebigint(20) unsigned  

Table 3-23. Schema for table user_perm

FieldTypeKeyDescription
user_idint(10) unsignedPrimary 
perm_idint(10) unsignedPrimary 

Table 3-24. Schema for table user_pref

FieldTypeKeyDescription
user_idint(10) unsignedPrimary 
email_noticestinyint(1) Whether the user wants to receive email notices from phpBugTracker. Values are 1 for yes (default) or 0 for no.

Table 3-25. Schema for table version

FieldTypeKeyDescription
version_idint(10) unsignedPrimary 
project_idint(10) unsigned  
version_namechar(10)  
activetinyint(1)  
created_byint(10) unsigned  
created_datebigint(20) unsigned  
last_modified_byint(10) unsigned  
last_modified_datebigint(20) unsigned