4.2. Database Schema

The bin/install.pl script contains the CREATE TABLE statements that are used when the Codestriker database is initialised, in the $table hash. The following tables are defined:


A Codestriker database can consist of a number of projects, which have a name, id, description and creation date. Each code review topic, is linked to a specific project.


A topic represents a code review that has been submitted to Codestriker. It contains attributes like the author, title, description, creation date, repository, and is linked to a member project.


A participant is associated with a topic, and contains an email address, and the type of participant they are, such as the author, reviewer or observer (somebody was is CC'ed for the review).


A comment is made against a specific review, and consists of the author and the comment text itself. It is linked with a specific commentstate object.


A commentstate row represents a comment block - a list of comments made against a specific file and line number. The comment block has the notion of state, whether it is marked "submitted", "complete" or "invalid".


This table records a many-to-many relationship between topics and bug ids. A topic may fix more than one bug id, and likewise, a bug id can be fixed by many topics.


A topic consists on many file objects, which contain a filename, revision number and an indicator as to whether it is a text or binary file. A file consists of one or more delta objects.


A delta is associated with a specific file object, and represents a single diff chunk or change. It represents for file X, at line number Y, the following change is a part of the review.


Records a trail as to who modified what topic properties and when that occurred.


Records a trail for the modification of comment blocks.


Records who has viewed a topic and when.


Records the value of a metric against a specific topic.


Records the value of a metric against a specific topic for a specific user.