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:

project

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.

topic

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.

participant

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).

commentdata

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.

commentstate

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".

topicbug

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.

topicfile

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.

delta

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.

topichistory

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

commentstatehistory

Records a trail for the modification of comment blocks.

topicviewhistory

Records who has viewed a topic and when.

topicmetric

Records the value of a metric against a specific topic.

topicusermetric

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