Skip to content

Instantly share code, notes, and snippets.

@cyberstream
Created February 8, 2012 05:49
Show Gist options
  • Save cyberstream/1765873 to your computer and use it in GitHub Desktop.
Save cyberstream/1765873 to your computer and use it in GitHub Desktop.
The SQL code for creating the reports table for the "Fix the Web" server-side project
CREATE TABLE IF NOT EXISTS `reports` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`report_id` int(11) DEFAULT NULL COMMENT 'If this is a comment, then this field should be the id of the report the comment is for',
`username` varchar(128) NOT NULL COMMENT 'The user''s Opera username',
`language` char(2) DEFAULT NULL COMMENT 'Two-character abbreviation for the language of this comment',
`category` tinyint(1) DEFAULT NULL COMMENT '1 => minor annoyance; 2 => major problem; 3 => site unusable',
`report` text NOT NULL COMMENT 'The content of the report or comment',
`page` varchar(510) DEFAULT NULL COMMENT 'The full URL of the page the error was reported about. NULL in comments',
`domain` varchar(255) DEFAULT NULL COMMENT 'The domain name of the site which the error report was submitted from; NULL in comments',
`opera_version` varchar(10) NOT NULL COMMENT 'opera.version()',
`opera_build` varchar(10) NOT NULL COMMENT 'opera.buildNumber()',
`operating_system` varchar(64) DEFAULT NULL COMMENT 'The information about the operating system of the commenter or reporter',
`additional_information` text COMMENT 'Other information about the user''s system, e.g. plugins, screen resolution and size, etc',
`post_type` tinyint(1) NOT NULL COMMENT '0 => an error report; 1 => is a comment, not a correction or solution; 2 => a comment, not a correction, is a solution; 3 => a comment, is a correction, but not a solution; 4 => a comment, is a correction and a solution',
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `page` (`page`(255),`post_type`)
) ENGINE=InnoDB;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment