xref: /web-bugs/sql/schema.sql (revision 16bea4f8)
1-- ts1     bug created date
2-- ts2     bug last updated date
3-- passwd  user password
4
5CREATE TABLE bugdb (
6  id int(8) NOT NULL auto_increment,
7  package_name varchar(80) default NULL,
8  bug_type varchar(32) NOT NULL default 'Bug',
9  email varchar(40) NOT NULL default '',
10  reporter_name varchar(80) default '',
11  sdesc varchar(80) NOT NULL default '',
12  ldesc text NOT NULL,
13  php_version varchar(100) default NULL,
14  php_os varchar(32) default NULL,
15  status varchar(16) default NULL,
16  ts1 datetime default NULL,
17  ts2 datetime default NULL,
18  assign varchar(20) default NULL,
19  passwd varchar(64) default NULL,
20  registered tinyint(1) NOT NULL default '0',
21  block_user_comment char(1) default 'N',
22  cve_id varchar(15) default NULL,
23  private char(1) default 'N',
24  visitor_ip varbinary(16) NOT NULL,
25  PRIMARY KEY (id),
26  KEY php_version (php_version(1)),
27  KEY status (status),
28  KEY package_name (package_name),
29  FULLTEXT KEY email (email,sdesc,ldesc)
30) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=1;
31
32CREATE TABLE bugdb_comments (
33  id int(8) NOT NULL auto_increment,
34  bug int(8) NOT NULL default '0',
35  email varchar(40) NOT NULL default '',
36  reporter_name varchar(80) default '',
37  ts datetime NOT NULL default CURRENT_TIMESTAMP,
38  comment text NOT NULL,
39  comment_type varchar(10) default 'comment',
40  visitor_ip varbinary(16) NOT NULL,
41  PRIMARY KEY  (id),
42  KEY bug (bug,id,ts),
43  FULLTEXT KEY comment (comment)
44) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=1;
45
46CREATE TABLE bugdb_obsoletes_patches (
47  bugdb_id int(8) NOT NULL,
48  patch varchar(80) NOT NULL,
49  revision int(8) NOT NULL,
50  obsolete_patch varchar(80) NOT NULL,
51  obsolete_revision int(8) NOT NULL,
52  PRIMARY KEY  (bugdb_id,patch,revision,obsolete_patch,obsolete_revision)
53) ENGINE=MyISAM DEFAULT CHARSET=utf8;
54
55CREATE TABLE bugdb_patchtracker (
56  bugdb_id int(8) NOT NULL,
57  patch varchar(80) NOT NULL,
58  revision int(8) NOT NULL,
59  developer varchar(40) NOT NULL,
60  PRIMARY KEY  (bugdb_id,patch,revision)
61) ENGINE=MyISAM DEFAULT CHARSET=utf8;
62
63CREATE TABLE bugdb_pseudo_packages (
64  id int(11) NOT NULL auto_increment,
65  parent int(11) NOT NULL default '0',
66  name varchar(80) NOT NULL default '',
67  long_name varchar(100) NOT NULL default '',
68  project varchar(40) NOT NULL default '',
69  list_email varchar(80) NOT NULL default '',
70  disabled tinyint(1) NOT NULL default 0, # Disabled == read-only (no new reports in these!)
71  PRIMARY KEY (id),
72  UNIQUE KEY (name, project)
73) ENGINE=MyISAM DEFAULT CHARSET=utf8;
74
75CREATE TABLE bugdb_resolves (
76  id int(11) NOT NULL auto_increment,
77  name varchar(100) NOT NULL,
78  status varchar(16) default NULL,
79  title varchar(100) NOT NULL,
80  message text NOT NULL,
81  project varchar(40) NOT NULL default '',
82  package_name varchar(80) default NULL,
83  webonly tinyint(1) NOT NULL default '0',
84  PRIMARY KEY  (id)
85) ENGINE=MyISAM DEFAULT CHARSET=utf8;
86
87CREATE TABLE bugdb_subscribe (
88  bug_id int(8) NOT NULL default '0',
89  email varchar(40) NOT NULL default '',
90  unsubscribe_date int(11) default NULL,
91  unsubscribe_hash varchar(80) default '',
92  PRIMARY KEY  (bug_id,email),
93  KEY unsubscribe_hash (unsubscribe_hash)
94) ENGINE=MyISAM DEFAULT CHARSET=utf8;
95
96-- score's value can be 1 through 5
97CREATE TABLE bugdb_votes (
98  bug int(8) NOT NULL default '0',
99  ts timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
100  ip int(10) unsigned NOT NULL default '0',
101  score int(3) NOT NULL default '0',
102  reproduced int(1) NOT NULL default '0',
103  tried int(1) NOT NULL default '0',
104  sameos int(1) default NULL,
105  samever int(1) default NULL
106) ENGINE=MyISAM DEFAULT CHARSET=utf8;
107
108CREATE TABLE bugdb_pulls (
109  bugdb_id int(8) NOT NULL default '0',
110  github_repo varchar(255) NOT NULL,
111  github_pull_id int NOT NULL,
112  github_title varchar(255) NOT NULL,
113  developer varchar(40) NOT NULL,
114  github_html_url varchar(255) NOT NULL,
115  PRIMARY KEY (bugdb_id, github_repo, github_pull_id)
116) ENGINE=MyISAM DEFAULT CHARSET=utf8;
117