|
From: Ulf E. <ulf...@us...> - 2005-08-23 21:09:50
|
Update of /cvsroot/phpbt/phpbt/schemas In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22034/phpbt/schemas Modified Files: mssql.in mysql.in oci8.in pgsql.in Log Message: Sorting and reformatting to simplify updates in future Index: mssql.in =================================================================== RCS file: /cvsroot/phpbt/phpbt/schemas/mssql.in,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- mssql.in 19 Jul 2005 19:46:50 -0000 1.1 +++ mssql.in 23 Aug 2005 21:09:42 -0000 1.2 @@ -3,6 +3,10 @@ # # $Id$ + + +#-- +# TBL_ATTACHMENT CREATE TABLE TBL_ATTACHMENT ( attachment_id id smallint NOT NULL default '0', bug_id smallint NOT NULL default '0', @@ -15,6 +19,9 @@ PRIMARY KEY (attachment_id) ); + +#-- +# TBL_AUTH_GROUP CREATE TABLE TBL_AUTH_GROUP ( group_id smallint NOT NULL default '0', group_name varchar(80) NOT NULL default '', @@ -27,6 +34,9 @@ PRIMARY KEY (group_id) ); + +#-- +# TBL_AUTH_PERM CREATE TABLE TBL_AUTH_PERM ( perm_id smallint NOT NULL default '0', perm_name varchar(80) NOT NULL default '', @@ -37,6 +47,9 @@ PRIMARY KEY (perm_id) ); + +#-- +# TBL_AUTH_USER CREATE TABLE TBL_AUTH_USER ( user_id smallint NOT NULL default '0', login char(40) NOT NULL default '', @@ -54,6 +67,9 @@ UNIQUE login (login) ); + +#-- +# TBL_BUG CREATE TABLE TBL_BUG ( bug_id smallint NOT NULL default '0', title varchar(100) NOT NULL default '', @@ -81,6 +97,9 @@ PRIMARY KEY (bug_id) ); + +#-- +# TBL_BUG_CC CREATE TABLE TBL_BUG_CC ( bug_id smallint NOT NULL default '0', user_id smallint NOT NULL default '0', @@ -89,18 +108,27 @@ PRIMARY KEY (bug_id,user_id) ); + +#-- +# TBL_BUG_DEPENDENCY CREATE TABLE TBL_BUG_DEPENDENCY ( bug_id smallint NOT NULL default '0', depends_on smallint NOT NULL default '0', PRIMARY KEY (bug_id,depends_on) ); + +#-- +# TBL_BUG_GROUP CREATE TABLE TBL_BUG_GROUP ( bug_id smallint NOT NULL default '0', group_id smallint NOT NULL default '0', PRIMARY KEY (bug_id,group_id), ); + +#-- +# TBL_BUG_HISTORY CREATE TABLE TBL_BUG_HISTORY ( bug_id smallint NOT NULL default '0', changed_field varchar(30) NOT NULL default '', @@ -110,6 +138,9 @@ created_date int NOT NULL default '0' ); + +#-- +# TBL_BUG_VOTE CREATE TABLE TBL_BUG_VOTE ( user_id smallint NOT NULL default '0', bug_id smallint NOT NULL default '0', @@ -117,6 +148,9 @@ PRIMARY KEY (user_id, bug_id), ); + +#-- +# TBL_COMMENT CREATE TABLE TBL_COMMENT ( comment_id smallint NOT NULL default '0', bug_id smallint NOT NULL default '0', @@ -126,6 +160,9 @@ PRIMARY KEY (comment_id) ); + +#-- +# TBL_COMPONENT CREATE TABLE TBL_COMPONENT ( component_id smallint NOT NULL default '0', project_id smallint NOT NULL default '0', @@ -140,6 +177,9 @@ PRIMARY KEY (component_id) ); + +#-- +# TBL_CONFIGURATION CREATE TABLE TBL_CONFIGURATION ( varname char(40) NOT NULL default '', varvalue char(255) NOT NULL default '', @@ -148,12 +188,28 @@ PRIMARY KEY (varname) ); + +#-- +# TBL_DATABASE +CREATE TABLE TBL_DATABASE ( + database_id tinyint NOT NULL default '0', + database_name varchar(40) NOT NULL default '', + sort_order tinyint NOT NULL default '0', + PRIMARY KEY (database_id) +); + + +#-- +# TBL_GROUP_PERM CREATE TABLE TBL_GROUP_PERM ( group_id smallint NOT NULL default '0', perm_id smallint NOT NULL default '0', PRIMARY KEY (group_id,perm_id), ); + +#-- +# TBL_OS CREATE TABLE TBL_OS ( os_id smallint NOT NULL default '0', os_name char(30) NOT NULL default '', @@ -162,6 +218,9 @@ PRIMARY KEY (os_id) ); + +#-- +# TBL_PROJECT CREATE TABLE TBL_PROJECT ( project_id smallint NOT NULL default '0', project_name varchar(30) NOT NULL default '', @@ -174,6 +233,9 @@ PRIMARY KEY (project_id) ); + +#-- +# TBL_PROJECT_GROUP CREATE TABLE TBL_PROJECT_GROUP ( project_id smallint NOT NULL default '0', group_id smallint NOT NULL default '0', @@ -182,11 +244,17 @@ PRIMARY KEY (project_id,group_id), ); + +#-- +# TBL_PROJECT_PERM CREATE TABLE TBL_PROJECT_PERM ( project_id smallint NOT NULL default '0', user_id smallint NOT NULL default '0' ); + +#-- +# TBL_RESOLUTION CREATE TABLE TBL_RESOLUTION ( resolution_id smallint NOT NULL default '0', resolution_name varchar(30) NOT NULL default '', @@ -195,6 +263,9 @@ PRIMARY KEY (resolution_id) ); + +#-- +# TBL_SAVED_QUERY CREATE TABLE TBL_SAVED_QUERY ( saved_query_id smallint NOT NULL default '0', user_id smallint NOT NULL default '0', @@ -203,6 +274,9 @@ PRIMARY KEY (saved_query_id,user_id) ); + +#-- +# TBL_SEVERITY CREATE TABLE TBL_SEVERITY ( severity_id smallint NOT NULL default '0', severity_name varchar(30) NOT NULL default '', @@ -212,6 +286,19 @@ PRIMARY KEY (severity_id) ); + +#-- +# TBL_SITE +CREATE TABLE TBL_SITE ( + site_id tinyint NOT NULL default '0', + site_name varchar(50) NOT NULL default '', + sort_order tinyint NOT NULL default '0', + PRIMARY KEY (site_id) +); + + +#-- +# TBL_STATUS CREATE TABLE TBL_STATUS ( status_id smallint NOT NULL default '0', status_name varchar(30) NOT NULL default '', @@ -221,6 +308,9 @@ PRIMARY KEY (status_id) ); + +#-- +# TBL_USER_GROUP CREATE TABLE TBL_USER_GROUP ( user_id smallint NOT NULL default '0', group_id smallint NOT NULL default '0', @@ -229,6 +319,9 @@ PRIMARY KEY (user_id,group_id), ); + +#-- +# TBL_USER_PERM CREATE TABLE TBL_USER_PERM ( user_id smallint NOT NULL default '0', perm_id smallint NOT NULL default '0', @@ -237,6 +330,9 @@ PRIMARY KEY (user_id,perm_id), ); + +#-- +# TBL_USER_PREF CREATE TABLE TBL_USER_PREF ( user_id smallint NOT NULL default '0', email_notices bit NOT NULL default '1', @@ -245,6 +341,9 @@ PRIMARY KEY (user_id) ); + +#-- +# TBL_VERSION CREATE TABLE TBL_VERSION ( version_id smallint NOT NULL default '0', project_id smallint NOT NULL default '0', @@ -257,52 +356,53 @@ PRIMARY KEY (version_id) ); -CREATE TABLE TBL_DATABASE ( - database_id tinyint NOT NULL default '0', - database_name varchar(40) NOT NULL default '', - sort_order tinyint NOT NULL default '0', - PRIMARY KEY (database_id) -); - -CREATE TABLE TBL_SITE ( - site_id tinyint NOT NULL default '0', - site_name varchar(50) NOT NULL default '', - sort_order tinyint NOT NULL default '0', - PRIMARY KEY (site_id) -); # # -- Insert initial data -- # + INSERT INTO TBL_AUTH_USER (user_id, login, first_name, last_name, email, password) - values (1, 'OPTION_ADMIN_EMAIL', 'System', 'Admin', 'OPTION_ADMIN_EMAIL', - 'OPTION_ADMIN_PASS'); + values (1, 'OPTION_ADMIN_EMAIL', 'System', 'Admin', + 'OPTION_ADMIN_EMAIL', 'OPTION_ADMIN_PASS'); + CREATE TABLE TBL_AUTH_USER_seq ([id] [int] IDENTITY (1, 1) NOT NULL, [vapor] [int] NULL) + # Start off with three user levels... INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (1, 'Admin', 1); INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (2, 'User', 1); INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked, assignable) VALUES (3, 'Developer', 1, 1); + CREATE TABLE TBL_AUTH_GROUP_seq ([id] [int] IDENTITY (3, 1) NOT NULL, [vapor] [int] NULL) -# ... and only two permissions + +# ... and three permissions INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (1, 'Admin'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (2, 'Editbug'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (3, 'EditAssignment'); -# Admins can do all the admin stuff and users can edit bugs + +# Admins can do all the admin stuff, and INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (1, 1); + +# users can edit bugs INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (2, 2); -# And user_id 1 is an admin and a user + +# Insert user_id 1 into the admin group INSERT INTO TBL_USER_GROUP (user_id, group_id) VALUES (1, 1); -INSERT INTO TBL_USER_GROUP (user_id, group_id) VALUES (1, 2); + # Add user's prefs as default values for all users defined so far (only admin) INSERT INTO TBL_USER_PREF (user_id) SELECT USER_ID FROM TBL_AUTH_USER; + +# +# -- Initialize the CONFIGURATION table -- +# + INSERT INTO TBL_CONFIGURATION VALUES ('INSTALL_URL','OPTION_INSTALL_URL','The base URL of the phpBugTracker installation','string'); INSERT INTO TBL_CONFIGURATION VALUES ('JPGRAPH_PATH','','If not in the include path. This is the file path on the web server, not a URL.','string'); INSERT INTO TBL_CONFIGURATION VALUES ('CVS_WEB','http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/phpbt/phpbt/','Location of your cvs web interface (see format_comments() in bug.php)','string'); @@ -334,6 +434,11 @@ INSERT INTO TBL_CONFIGURATION VALUES ('BUG_REOPENED','4','The status to assign a bug when it is reopened.','multi'); INSERT INTO TBL_CONFIGURATION VALUES ('EMAIL_DISABLED', '0', 'Whether to disable all mail sent from the system', 'bool'); + +# +# -- Initialize the OS table -- +# + INSERT INTO TBL_OS VALUES (1,'All',1,''); INSERT INTO TBL_OS VALUES (2,'Windows 3.1',2,'/Mozilla.*\\(Win16.*\\)/'); INSERT INTO TBL_OS VALUES (3,'Windows 95',3,'/Mozilla.*\\(.*;.*; 32bit.*\\)/'); @@ -365,16 +470,28 @@ INSERT INTO TBL_OS VALUES (29,'Solaris',29,'/Mozilla.*\\(.*;.*; SunOS 5.*\\)/'); INSERT INTO TBL_OS VALUES (30,'SunOS',30,'/Mozilla.*\\(.*;.*; SunOS.*\\)/'); INSERT INTO TBL_OS VALUES (31,'other',31,''); + CREATE TABLE TBL_OS_seq ([id] [int] IDENTITY (31, 1) NOT NULL, [vapor] [int] NULL) + +# +# -- Initialize the RESOLUTION table -- +# + INSERT INTO TBL_RESOLUTION VALUES (1,'Fixed','Bug was eliminated',1); INSERT INTO TBL_RESOLUTION VALUES (2,'Not a bug','It''s not a bug -- it''s a feature!',2); INSERT INTO TBL_RESOLUTION VALUES (3,'Won''t Fix','This bug will stay',3); INSERT INTO TBL_RESOLUTION VALUES (4,'Deferred','We''ll get around to it later',4); INSERT INTO TBL_RESOLUTION VALUES (5,'Works for me','Can''t replicate the bug',5); INSERT INTO TBL_RESOLUTION VALUES (6,'Duplicate','',6); + CREATE TABLE TBL_RESOLUTION_seq ([id] [int] IDENTITY (6, 1) NOT NULL, [vapor] [int] NULL) + +# +# -- Initialize the SEVERITY table -- +# + INSERT INTO TBL_SEVERITY VALUES (1,'Unassigned','Default bug creation',1,'#dadada'); INSERT INTO TBL_SEVERITY VALUES (2,'Idea','Ideas for further development',2,'#dad0d0'); INSERT INTO TBL_SEVERITY VALUES (3,'Feature Request','Requests for specific features',3,'#dacaca'); @@ -382,8 +499,14 @@ INSERT INTO TBL_SEVERITY VALUES (5,'Content','Non-functional related bugs, such as text content',5,'#dababa'); INSERT INTO TBL_SEVERITY VALUES (6,'Significant','A bug affecting the intended performance of the product',6,'#dab0b0'); INSERT INTO TBL_SEVERITY VALUES (7,'Critical','A bug severe enough to prevent the release of the product',7,'#daaaaa'); + CREATE TABLE TBL_SEVERITY_seq ([id] [int] IDENTITY (7, 1) NOT NULL, [vapor] [int] NULL) + +# +# -- Initialize the STATUS table -- +# + INSERT INTO TBL_STATUS VALUES (1,'Unconfirmed','Reported but not confirmed',1, 1); INSERT INTO TBL_STATUS VALUES (2,'New','A new bug',2,1); INSERT INTO TBL_STATUS VALUES (3,'Assigned','Assigned to a developer',3,1); @@ -391,24 +514,43 @@ INSERT INTO TBL_STATUS VALUES (5,'Resolved','Set by engineer with a resolution',5,0); INSERT INTO TBL_STATUS VALUES (6,'Verified','The resolution is confirmed by the reporter',6,0); INSERT INTO TBL_STATUS VALUES (7,'Closed','The bug is officially squashed (QA)',7,0); + CREATE TABLE TBL_STATUS_seq ([id] [int] IDENTITY (7, 1) NOT NULL, [vapor] [int] NULL) + +# +# -- Initialize the DATABASE table -- +# + INSERT INTO TBL_DATABASE VALUES (1,'Oracle 8.1.7',1); INSERT INTO TBL_DATABASE VALUES (2,'MySQL 3.23.49',2); INSERT INTO TBL_DATABASE VALUES (3,'PostgreSQL 7.1.3',3); + CREATE TABLE TBL_DATABASE_seq ([id] [int] IDENTITY (3, 1) NOT NULL, [vapor] [int] NULL) + +# +# -- Initialize the SITE table -- +# + # Examples only INSERT INTO TBL_SITE VALUES (0,'All',1); INSERT INTO TBL_SITE VALUES (1,'Production - location 1',2); INSERT INTO TBL_SITE VALUES (2,'Production - location 2',3); INSERT INTO TBL_SITE VALUES (3,'Test site - location 1',4); INSERT INTO TBL_SITE VALUES (4,'Test site - location 2',5); + CREATE TABLE TBL_SITE_seq ([id] [int] IDENTITY (4, 1) NOT NULL, [vapor] [int] NULL) -#-- Sequences for the tables with no initial entries + +# +# -- Sequences for the tables with no initial entries -- +# + CREATE TABLE TBL_BUG_seq ([id] [int] IDENTITY (1, 1) NOT NULL, [vapor] [int] NULL) CREATE TABLE TBL_COMMENT_seq ([id] [int] IDENTITY (1, 1) NOT NULL, [vapor] [int] NULL) CREATE TABLE TBL_COMPONENT_seq ([id] [int] IDENTITY (1, 1) NOT NULL, [vapor] [int] NULL) CREATE TABLE TBL_PROJECT_seq ([id] [int] IDENTITY (1, 1) NOT NULL, [vapor] [int] NULL) CREATE TABLE TBL_VERSION_seq ([id] [int] IDENTITY (1, 1) NOT NULL, [vapor] [int] NULL) + +#-- Index: mysql.in =================================================================== RCS file: /cvsroot/phpbt/phpbt/schemas/mysql.in,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- mysql.in 22 Aug 2005 20:30:56 -0000 1.49 +++ mysql.in 23 Aug 2005 21:09:42 -0000 1.50 @@ -3,6 +3,10 @@ # # $Id$ + + +#-- +# TBL_ATTACHMENT CREATE TABLE TBL_ATTACHMENT ( attachment_id int(10) unsigned NOT NULL default '0', bug_id int(10) unsigned NOT NULL default '0', @@ -15,6 +19,9 @@ PRIMARY KEY (attachment_id) ) TYPE=MyISAM; + +#-- +# TBL_AUTH_GROUP CREATE TABLE TBL_AUTH_GROUP ( group_id int(10) unsigned NOT NULL default '0', group_name varchar(80) NOT NULL default '', @@ -26,6 +33,9 @@ PRIMARY KEY (group_id) ) TYPE=MyISAM; + +#-- +# TBL_AUTH_PERM CREATE TABLE TBL_AUTH_PERM ( perm_id int(10) unsigned NOT NULL default '0', perm_name varchar(80) NOT NULL default '', @@ -36,6 +46,9 @@ PRIMARY KEY (perm_id) ) TYPE=MyISAM; + +#-- +# TBL_AUTH_USER CREATE TABLE TBL_AUTH_USER ( user_id int(10) unsigned NOT NULL default '0', login char(40) NOT NULL default '', @@ -53,6 +66,17 @@ UNIQUE KEY login (login) ) TYPE=MyISAM; + +#-- +# TBL_BOOKMARK +CREATE TABLE TBL_BOOKMARK ( + user_id int(10) unsigned NOT NULL default '0', + bug_id int(10) unsigned NOT NULL default '0' +) TYPE=MyISAM; + + +#-- +# TBL_BUG CREATE TABLE TBL_BUG ( bug_id int(10) unsigned NOT NULL default '0', title varchar(100) NOT NULL default '', @@ -80,6 +104,9 @@ PRIMARY KEY (bug_id) ) TYPE=MyISAM; + +#-- +# TBL_BUG_CC CREATE TABLE TBL_BUG_CC ( bug_id int(10) unsigned NOT NULL default '0', user_id int(10) unsigned NOT NULL default '0', @@ -88,12 +115,18 @@ PRIMARY KEY (bug_id,user_id) ) TYPE=MyISAM; + +#-- +# TBL_BUG_DEPENDENCY CREATE TABLE TBL_BUG_DEPENDENCY ( bug_id int(10) unsigned NOT NULL default '0', depends_on int(10) unsigned NOT NULL default '0', PRIMARY KEY (bug_id,depends_on) ) TYPE=MyISAM; + +#-- +# TBL_BUG_GROUP CREATE TABLE TBL_BUG_GROUP ( bug_id int(10) unsigned NOT NULL default '0', group_id int(10) unsigned NOT NULL default '0', @@ -101,6 +134,9 @@ KEY group_id (group_id) ) TYPE=MyISAM; + +#-- +# TBL_BUG_HISTORY CREATE TABLE TBL_BUG_HISTORY ( bug_id int(10) unsigned NOT NULL default '0', changed_field varchar(30) NOT NULL default '', @@ -110,6 +146,9 @@ created_date bigint(20) unsigned NOT NULL default '0' ) TYPE=MyISAM; + +#-- +# TBL_BUG_VOTE CREATE TABLE TBL_BUG_VOTE ( user_id int(10) unsigned NOT NULL default '0', bug_id int(10) unsigned NOT NULL default '0', @@ -118,6 +157,9 @@ KEY bug_id (bug_id) ) TYPE=MyISAM; + +#-- +# TBL_COMMENT CREATE TABLE TBL_COMMENT ( comment_id int(10) unsigned NOT NULL default '0', bug_id int(10) unsigned NOT NULL default '0', @@ -127,6 +169,9 @@ PRIMARY KEY (comment_id) ) TYPE=MyISAM; + +#-- +# TBL_COMPONENT CREATE TABLE TBL_COMPONENT ( component_id int(10) unsigned NOT NULL default '0', project_id int(10) unsigned NOT NULL default '0', @@ -142,6 +187,9 @@ PRIMARY KEY (component_id) ) TYPE=MyISAM; + +#-- +# TBL_CONFIGURATION CREATE TABLE TBL_CONFIGURATION ( varname char(40) NOT NULL default '', varvalue char(255) NOT NULL default '', @@ -150,6 +198,19 @@ PRIMARY KEY (varname) ) TYPE=MyISAM; + +#-- +# TBL_DATABASE +CREATE TABLE TBL_DATABASE ( + database_id tinyint(3) unsigned NOT NULL default '0', + database_name varchar(40) NOT NULL default '', + sort_order tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (database_id) +) TYPE=MyISAM; + + +#-- +# TBL_GROUP_PERM CREATE TABLE TBL_GROUP_PERM ( group_id int(10) unsigned NOT NULL default '0', perm_id int(10) unsigned NOT NULL default '0', @@ -157,6 +218,9 @@ KEY perm_id (perm_id) ) TYPE=MyISAM; + +#-- +# TBL_OS CREATE TABLE TBL_OS ( os_id int(10) unsigned NOT NULL default '0', os_name char(30) NOT NULL default '', @@ -165,6 +229,21 @@ PRIMARY KEY (os_id) ) TYPE=MyISAM; + +#-- +# TBL_PRIORITY +CREATE TABLE TBL_PRIORITY ( + priority_id int(10) unsigned NOT NULL default '0', + priority_name varchar(30) NOT NULL default '', + priority_desc text NOT NULL, + sort_order tinyint(3) unsigned NOT NULL default '0', + priority_color varchar(10) NOT NULL default '#FFFFFF', + PRIMARY KEY (priority_id) +) TYPE=MyISAM; + + +#-- +# TBL_PROJECT CREATE TABLE TBL_PROJECT ( project_id int(10) unsigned NOT NULL default '0', project_name varchar(30) NOT NULL default '', @@ -177,6 +256,9 @@ PRIMARY KEY (project_id) ) TYPE=MyISAM; + +#-- +# TBL_PROJECT_GROUP CREATE TABLE TBL_PROJECT_GROUP ( project_id int(10) unsigned NOT NULL default '0', group_id int(10) unsigned NOT NULL default '0', @@ -186,11 +268,17 @@ KEY group_id (group_id) ) TYPE=MyISAM; + +#-- +# TBL_PROJECT_PERM CREATE TABLE TBL_PROJECT_PERM ( project_id int(11) NOT NULL default '0', user_id int(11) NOT NULL default '0' ) TYPE=MyISAM; + +#-- +# TBL_RESOLUTION CREATE TABLE TBL_RESOLUTION ( resolution_id int(10) unsigned NOT NULL default '0', resolution_name varchar(30) NOT NULL default '', @@ -199,6 +287,9 @@ PRIMARY KEY (resolution_id) ) TYPE=MyISAM; + +#-- +# TBL_SAVED_QUERY CREATE TABLE TBL_SAVED_QUERY ( saved_query_id int(10) unsigned NOT NULL default '0', user_id int(10) unsigned NOT NULL default '0', @@ -207,6 +298,9 @@ PRIMARY KEY (saved_query_id,user_id) ) TYPE=MyISAM; + +#-- +# TBL_SEVERITY CREATE TABLE TBL_SEVERITY ( severity_id int(10) unsigned NOT NULL default '0', severity_name varchar(30) NOT NULL default '', @@ -216,15 +310,19 @@ PRIMARY KEY (severity_id) ) TYPE=MyISAM; -CREATE TABLE TBL_PRIORITY ( - priority_id int(10) unsigned NOT NULL default '0', - priority_name varchar(30) NOT NULL default '', - priority_desc text NOT NULL, + +#-- +# TBL_SITE +CREATE TABLE TBL_SITE ( + site_id tinyint(3) unsigned NOT NULL default '0', + site_name varchar(50) NOT NULL default '', sort_order tinyint(3) unsigned NOT NULL default '0', - priority_color varchar(10) NOT NULL default '#FFFFFF', - PRIMARY KEY (priority_id) + PRIMARY KEY (site_id) ) TYPE=MyISAM; + +#-- +# TBL_STATUS CREATE TABLE TBL_STATUS ( status_id int(10) unsigned NOT NULL default '0', status_name varchar(30) NOT NULL default '', @@ -234,6 +332,9 @@ PRIMARY KEY (status_id) ) TYPE=MyISAM; + +#-- +# TBL_USER_GROUP CREATE TABLE TBL_USER_GROUP ( user_id int(10) unsigned NOT NULL default '0', group_id int(10) unsigned NOT NULL default '0', @@ -243,6 +344,9 @@ KEY group_id (group_id) ) TYPE=MyISAM; + +#-- +# TBL_USER_PERM CREATE TABLE TBL_USER_PERM ( user_id int(10) unsigned NOT NULL default '0', perm_id int(10) unsigned NOT NULL default '0', @@ -252,6 +356,9 @@ KEY perm_id (perm_id) ) TYPE=MyISAM; + +#-- +# TBL_USER_PREF CREATE TABLE TBL_USER_PREF ( user_id int(11) NOT NULL default '0', email_notices tinyint(1) NOT NULL default '1', @@ -260,6 +367,9 @@ PRIMARY KEY (user_id) ) TYPE=MyISAM; + +#-- +# TBL_VERSION CREATE TABLE TBL_VERSION ( version_id int(10) unsigned NOT NULL default '0', project_id int(10) unsigned NOT NULL default '0', @@ -273,62 +383,62 @@ PRIMARY KEY (version_id) ) TYPE=MyISAM; -CREATE TABLE TBL_DATABASE ( - database_id tinyint(3) unsigned NOT NULL default '0', - database_name varchar(40) NOT NULL default '', - sort_order tinyint(3) unsigned NOT NULL default '0', - PRIMARY KEY (database_id) -) TYPE=MyISAM; - -CREATE TABLE TBL_SITE ( - site_id tinyint(3) unsigned NOT NULL default '0', - site_name varchar(50) NOT NULL default '', - sort_order tinyint(3) unsigned NOT NULL default '0', - PRIMARY KEY (site_id) -) TYPE=MyISAM; - -CREATE TABLE TBL_BOOKMARK ( - user_id int(10) unsigned NOT NULL default '0', - bug_id int(10) unsigned NOT NULL default '0' -) TYPE=MyISAM; # # -- Insert initial data -- # + INSERT INTO TBL_AUTH_USER (user_id, login, first_name, last_name, email, password) - values (1, 'OPTION_ADMIN_EMAIL', 'System', 'Admin', 'OPTION_ADMIN_EMAIL', - 'OPTION_ADMIN_PASS'); -create table TBL_AUTH_USER_seq (id int unsigned auto_increment not null primary key); -insert into TBL_AUTH_USER_seq values (1); + values (1, 'OPTION_ADMIN_EMAIL', 'System', 'Admin', + 'OPTION_ADMIN_EMAIL', 'OPTION_ADMIN_PASS'); + +CREATE TABLE TBL_AUTH_USER_seq ( + id int unsigned auto_increment not null primary key); +INSERT INTO TBL_AUTH_USER_seq values (1); + # Start off with three user levels... INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (1, 'Admin', 1); INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (2, 'User', 1); INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (3, 'Developer', 1); -create table TBL_AUTH_GROUP_seq (id int unsigned auto_increment not null primary key); -insert into TBL_AUTH_GROUP_seq values (3); -# ... and only two permissions +CREATE TABLE TBL_AUTH_GROUP_seq ( + id int unsigned auto_increment not null primary key); +INSERT INTO TBL_AUTH_GROUP_seq values (3); + + +# ... and four permissions INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (1, 'Admin'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (2, 'Editbug'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (3, 'EditAssignment'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (4, 'Assignable'); -# Admins can do all the admin stuff, users can edit bugs, and -# developers are users who can own bugs + +# Admins can do all the admin stuff, INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (1, 1); + +# users can edit bugs, and INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (2, 2); + +# developers are users who can own bugs INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (3, 2); INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (3, 4); -# Insert user_id 1 into the admin group + +# Insert user_id 1 into the admin group INSERT INTO TBL_USER_GROUP (user_id, group_id) VALUES (1, 1); + # Add user's prefs as default values for all users defined so far (only admin) INSERT INTO TBL_USER_PREF (user_id) SELECT USER_ID FROM TBL_AUTH_USER; + +# +# -- Initialize the CONFIGURATION table -- +# + INSERT INTO TBL_CONFIGURATION VALUES ('INSTALL_URL','OPTION_INSTALL_URL','The base URL of the phpBugTracker installation','string'); INSERT INTO TBL_CONFIGURATION VALUES ('JPGRAPH_PATH','','If not in the include path. This is the file path on the web server, not a URL.','string'); INSERT INTO TBL_CONFIGURATION VALUES ('CVS_WEB','http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/phpbt/phpbt/','Location of your cvs web interface (see format_comments() in bug.php)','string'); @@ -361,6 +471,11 @@ INSERT INTO TBL_CONFIGURATION VALUES ('BUG_REOPENED','4','The status to assign a bug when it is reopened.','multi'); INSERT INTO TBL_CONFIGURATION VALUES ('EMAIL_DISABLED', '0', 'Whether to disable all mail sent from the system', 'bool'); + +# +# -- Initialize the OS table -- +# + INSERT INTO TBL_OS VALUES (1,'All',1,''); INSERT INTO TBL_OS VALUES (2,'Windows 3.1',2,'/Mozilla.*\\(Win16.*\\)/'); INSERT INTO TBL_OS VALUES (3,'Windows 95',3,'/Mozilla.*\\(.*;.*; 32bit.*\\)/'); @@ -392,8 +507,15 @@ INSERT INTO TBL_OS VALUES (29,'Solaris',29,'/Mozilla.*\\(.*;.*; SunOS 5.*\\)/'); INSERT INTO TBL_OS VALUES (30,'SunOS',30,'/Mozilla.*\\(.*;.*; SunOS.*\\)/'); INSERT INTO TBL_OS VALUES (31,'other',31,''); -create table TBL_OS_seq (id int unsigned auto_increment not null primary key); -insert into TBL_OS_seq values (31); + +CREATE TABLE TBL_OS_seq ( + id int unsigned auto_increment not null primary key); +INSERT INTO TBL_OS_seq values (31); + + +# +# -- Initialize the RESOLUTION table -- +# INSERT INTO TBL_RESOLUTION VALUES (1,'Fixed','Bug was eliminated',1); INSERT INTO TBL_RESOLUTION VALUES (2,'Not a bug','It''s not a bug -- it''s a feature!',2); @@ -401,8 +523,15 @@ INSERT INTO TBL_RESOLUTION VALUES (4,'Deferred','We''ll get around to it later',4); INSERT INTO TBL_RESOLUTION VALUES (5,'Works for me','Can''t replicate the bug',5); INSERT INTO TBL_RESOLUTION VALUES (6,'Duplicate','',6); -create table TBL_RESOLUTION_seq (id int unsigned auto_increment not null primary key); -insert into TBL_RESOLUTION_seq values (6); + +CREATE TABLE TBL_RESOLUTION_seq ( + id int unsigned auto_increment not null primary key); +INSERT INTO TBL_RESOLUTION_seq values (6); + + +# +# -- Initialize the SEVERITY table -- +# INSERT INTO TBL_SEVERITY VALUES (1,'Unassigned','Default bug creation',1,'#dadada'); INSERT INTO TBL_SEVERITY VALUES (2,'Idea','Ideas for further development',2,'#dad0d0'); @@ -411,32 +540,60 @@ INSERT INTO TBL_SEVERITY VALUES (5,'Content','Non-functional related bugs, such as text content',5,'#dababa'); INSERT INTO TBL_SEVERITY VALUES (6,'Significant','A bug affecting the intended performance of the product',6,'#dab0b0'); INSERT INTO TBL_SEVERITY VALUES (7,'Critical','A bug severe enough to prevent the release of the product',7,'#daaaaa'); -create table TBL_SEVERITY_seq (id int unsigned auto_increment not null primary key); -insert into TBL_SEVERITY_seq values (7); + +CREATE TABLE TBL_SEVERITY_seq ( + id int unsigned auto_increment not null primary key); +INSERT INTO TBL_SEVERITY_seq values (7); + + +# +# -- Initialize the PRIORITY table -- +# INSERT INTO TBL_PRIORITY VALUES (1,'Low','Fix if possible',1,'#dadada'); INSERT INTO TBL_PRIORITY VALUES (2,'Medium Low','Must fix before final',2,'#dad0d0'); INSERT INTO TBL_PRIORITY VALUES (3,'Medium','Fix before next milestone (alpha, beta, etc.)',3,'#dac0c0'); INSERT INTO TBL_PRIORITY VALUES (4,'Medium High','Fix as soon as possible',4,'#dab0b0'); INSERT INTO TBL_PRIORITY VALUES (5,'High','Fix immediately',5,'#daaaaa'); -create table TBL_PRIORITY_seq (id int unsigned auto_increment not null primary key); -insert into TBL_PRIORITY_seq values (5); -INSERT INTO TBL_STATUS VALUES (1,'Unconfirmed','Reported but not confirmed',1, 1); +CREATE TABLE TBL_PRIORITY_seq ( + id int unsigned auto_increment not null primary key); +INSERT INTO TBL_PRIORITY_seq values (5); + + +# +# -- Initialize the STATUS table -- +# + +INSERT INTO TBL_STATUS VALUES (1,'Unconfirmed','Reported but not confirmed',1,1); INSERT INTO TBL_STATUS VALUES (2,'New','A new bug',2,1); INSERT INTO TBL_STATUS VALUES (3,'Assigned','Assigned to a developer',3,1); INSERT INTO TBL_STATUS VALUES (4,'Reopened','Closed but opened again for further inspection',4,1); INSERT INTO TBL_STATUS VALUES (5,'Resolved','Set by engineer with a resolution',5,0); INSERT INTO TBL_STATUS VALUES (6,'Verified','The resolution is confirmed by the reporter',6,0); INSERT INTO TBL_STATUS VALUES (7,'Closed','The bug is officially squashed (QA)',7,0); -create table TBL_STATUS_seq (id int unsigned auto_increment not null primary key); -insert into TBL_STATUS_seq values (7); + +CREATE TABLE TBL_STATUS_seq ( + id int unsigned auto_increment not null primary key); +INSERT INTO TBL_STATUS_seq values (7); + + +# +# -- Initialize the DATABASE table -- +# INSERT INTO TBL_DATABASE VALUES (1,'Oracle 8.1.7',1); INSERT INTO TBL_DATABASE VALUES (2,'MySQL 3.23.49',2); INSERT INTO TBL_DATABASE VALUES (3,'PostgreSQL 7.1.3',3); -create table TBL_DATABASE_seq (id int unsigned auto_increment not null primary key); -insert into TBL_DATABASE_seq values (3); + +CREATE TABLE TBL_DATABASE_seq ( + id int unsigned auto_increment not null primary key); +INSERT INTO TBL_DATABASE_seq values (3); + + +# +# -- Initialize the SITE table -- +# # Examples only INSERT INTO TBL_SITE VALUES (0,'All',1); @@ -444,17 +601,34 @@ INSERT INTO TBL_SITE VALUES (2,'Production - location 2',3); INSERT INTO TBL_SITE VALUES (3,'Test site - location 1',4); INSERT INTO TBL_SITE VALUES (4,'Test site - location 2',5); -create table TBL_SITE_seq (id int unsigned auto_increment not null primary key); -insert into TBL_SITE_seq values (4); -#-- Sequences for the tables with no initial entries -create table TBL_BUG_seq (id int unsigned auto_increment not null primary key); -insert into TBL_BUG_seq values(1); -create table TBL_COMMENT_seq (id int unsigned auto_increment not null primary key); -insert into TBL_COMMENT_seq values(1); -create table TBL_COMPONENT_seq (id int unsigned auto_increment not null primary key); -insert into TBL_COMPONENT_seq values(1); -create table TBL_PROJECT_seq (id int unsigned auto_increment not null primary key); -insert into TBL_PROJECT_seq values(1); -create table TBL_VERSION_seq (id int unsigned auto_increment not null primary key); -insert into TBL_VERSION_seq values(1); +CREATE TABLE TBL_SITE_seq ( + id int unsigned auto_increment not null primary key); +INSERT INTO TBL_SITE_seq values (4); + + +# +# -- Sequences for the tables with no initial entries -- +# + +CREATE TABLE TBL_BUG_seq ( + id int unsigned auto_increment not null primary key); +INSERT INTO TBL_BUG_seq values(1); + +CREATE TABLE TBL_COMMENT_seq ( + id int unsigned auto_increment not null primary key); +INSERT INTO TBL_COMMENT_seq values(1); + +CREATE TABLE TBL_COMPONENT_seq ( + id int unsigned auto_increment not null primary key); +INSERT INTO TBL_COMPONENT_seq values(1); + +CREATE TABLE TBL_PROJECT_seq ( + id int unsigned auto_increment not null primary key); +INSERT INTO TBL_PROJECT_seq values(1); + +CREATE TABLE TBL_VERSION_seq ( + id int unsigned auto_increment not null primary key); +INSERT INTO TBL_VERSION_seq values(1); + +#-- Index: oci8.in =================================================================== RCS file: /cvsroot/phpbt/phpbt/schemas/oci8.in,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- oci8.in 20 Jun 2005 01:05:29 -0000 1.28 +++ oci8.in 23 Aug 2005 21:09:42 -0000 1.29 @@ -1,9 +1,12 @@ +# Oracle database creation script +# This is a template for install.php -- not for creating the database! +# +# $Id$ --- Oracle database creation script --- This is a template for install.php -- not for creating the database! --- --- $Id$ + +#-- +# TBL_ATTACHMENT CREATE TABLE TBL_ATTACHMENT ( attachment_id number(10) default '0' NOT NULL, bug_id number(10) default '0' NOT NULL, @@ -16,6 +19,9 @@ PRIMARY KEY (attachment_id) ) ; + +#-- +# TBL_AUTH_GROUP CREATE TABLE TBL_AUTH_GROUP ( group_id number(10) default '0' NOT NULL, group_name varchar2(80) default '' NOT NULL, @@ -28,6 +34,9 @@ PRIMARY KEY (group_id) ) ; + +#-- +# TBL_AUTH_PERM CREATE TABLE TBL_AUTH_PERM ( perm_id number(10) default '0' NOT NULL, perm_name varchar2(80) default '' NOT NULL, @@ -38,6 +47,9 @@ PRIMARY KEY (perm_id) ) ; + +#-- +# TBL_AUTH_USER CREATE TABLE TBL_AUTH_USER ( user_id number(10) default '0' NOT NULL, login varchar2(40) default '' NOT NULL UNIQUE, @@ -54,6 +66,9 @@ PRIMARY KEY (user_id) ) ; + +#-- +# TBL_BUG CREATE TABLE TBL_BUG ( bug_id number(10) default '0' NOT NULL, title varchar2(100) default '' NOT NULL, @@ -81,6 +96,9 @@ PRIMARY KEY (bug_id) ) ; + +#-- +# TBL_BUG_CC CREATE TABLE TBL_BUG_CC ( bug_id number(10) default '0' NOT NULL, user_id number(10) default '0' NOT NULL, @@ -89,12 +107,18 @@ PRIMARY KEY (bug_id ,user_id) ) ; + +#-- +# TBL_BUG_DEPENDENCY CREATE TABLE TBL_BUG_DEPENDENCY ( bug_id number(10) default '0' NOT NULL, depends_on number(10) default '0' NOT NULL, PRIMARY KEY (bug_id ,depends_on) ) ; + +#-- +# TBL_BUG_GROUP CREATE TABLE TBL_BUG_GROUP ( bug_id number(10) default '0' NOT NULL, group_id number(10) default '0' NOT NULL, @@ -103,6 +127,9 @@ CREATE INDEX GROUPIDX ON TBL_BUG_GROUP ( group_id ); + +#-- +# TBL_BUG_HISTORY CREATE TABLE TBL_BUG_HISTORY ( bug_id number(10) default '0' NOT NULL, changed_field varchar2(30) default '' NOT NULL, @@ -112,6 +139,9 @@ created_date number(20) default '0' ) ; + +#-- +# TBL_BUG_VOTE CREATE TABLE TBL_BUG_VOTE ( user_id number(10) default '0' NOT NULL, bug_id number(10) default '0' NOT NULL, @@ -121,6 +151,9 @@ CREATE INDEX BUGIDX ON TBL_BUG_VOTE ( bug_id ); + +#-- +# TBL_COMMENT CREATE TABLE TBL_COMMENT ( comment_id number(10) default '0' NOT NULL, bug_id number(10) default '0' NOT NULL, @@ -130,6 +163,9 @@ PRIMARY KEY (comment_id) ) ; + +#-- +# TBL_COMPONENT CREATE TABLE TBL_COMPONENT ( component_id number(10) default '0' NOT NULL, project_id number(10) default '0' NOT NULL, @@ -144,6 +180,9 @@ PRIMARY KEY (component_id) ) ; + +#-- +# TBL_CONFIGURATION CREATE TABLE TBL_CONFIGURATION ( varname varchar2(40) default '' NOT NULL, varvalue varchar2(255) default '' , @@ -152,6 +191,9 @@ PRIMARY KEY (varname) ) ; + +#-- +# TBL_GROUP_PERM CREATE TABLE TBL_GROUP_PERM ( group_id number(10) default '0' NOT NULL, perm_id number(10) default '0' NOT NULL, @@ -160,6 +202,9 @@ CREATE INDEX PERMIDX ON TBL_GROUP_PERM ( perm_id ); + +#-- +# TBL_OS CREATE TABLE TBL_OS ( os_id number(10) default '0' NOT NULL, os_name varchar2(30) default '' NOT NULL, @@ -168,6 +213,9 @@ PRIMARY KEY (os_id) ) ; + +#-- +# TBL_PROJECT CREATE TABLE TBL_PROJECT ( project_id number(10) default '0' NOT NULL, project_name varchar2(30) default '' NOT NULL, @@ -180,6 +228,9 @@ PRIMARY KEY (project_id) ) ; + +#-- +# TBL_PROJECT_GROUP CREATE TABLE TBL_PROJECT_GROUP ( project_id number(10) default '0' NOT NULL, group_id number(10) default '0' NOT NULL, @@ -190,11 +241,17 @@ CREATE INDEX GROUPPROJIDX ON TBL_PROJECT_GROUP ( group_id ); + +#-- +# TBL_PROJECT_PERM CREATE TABLE TBL_PROJECT_PERM ( project_id number(10) default '0' NOT NULL, user_id number(10) default '0' NOT NULL ); + +#-- +# TBL_RESOLUTION CREATE TABLE TBL_RESOLUTION ( resolution_id number(10) default '0' NOT NULL, resolution_name varchar2(30) default '' NOT NULL, @@ -203,6 +260,9 @@ PRIMARY KEY (resolution_id) ) ; + +#-- +# TBL_SAVED_QUERY CREATE TABLE TBL_SAVED_QUERY ( saved_query_id number(10) default '0' NOT NULL, user_id number(10) default '0' NOT NULL, @@ -211,6 +271,9 @@ PRIMARY KEY (saved_query_id ,user_id) ) ; + +#-- +# TBL_SEVERITY CREATE TABLE TBL_SEVERITY ( severity_id number(10) default '0' NOT NULL, severity_name varchar2(30) default '' NOT NULL, @@ -220,6 +283,9 @@ PRIMARY KEY (severity_id) ) ; + +#-- +# TBL_STATUS CREATE TABLE TBL_STATUS ( status_id number(10) default '0' NOT NULL, status_name varchar2(30) default '' NOT NULL, @@ -229,6 +295,9 @@ PRIMARY KEY (status_id) ) ; + +#-- +# TBL_USER_GROUP CREATE TABLE TBL_USER_GROUP ( user_id number(10) default '0' NOT NULL, group_id number(10) default '0' NOT NULL, @@ -239,6 +308,9 @@ CREATE INDEX GROUPUSERIDX ON TBL_USER_GROUP ( group_id ); + +#-- +# TBL_USER_PERM CREATE TABLE TBL_USER_PERM ( user_id number(10) default '0' NOT NULL, perm_id number(10) default '0' NOT NULL, @@ -246,8 +318,12 @@ created_date number(20) default '0' NOT NULL, PRIMARY KEY (user_id ,perm_id) ) ; + CREATE INDEX PERMUSERIDX ON TBL_USER_PERM ( perm_id ); + +#-- +# TBL_USER_PREF CREATE TABLE TBL_USER_PREF ( user_id number(10) default '0' NOT NULL, email_notices number(1) default '1' NOT NULL, @@ -256,6 +332,9 @@ PRIMARY KEY (user_id) ); + +#-- +# TBL_VERSION CREATE TABLE TBL_VERSION ( version_id number(10) default '0' NOT NULL, project_id number(10) default '0' NOT NULL, @@ -268,6 +347,9 @@ PRIMARY KEY (version_id) ) ; + +#-- +# TBL_DATABASE CREATE TABLE TBL_DATABASE ( database_id number(3) default '0' NOT NULL, database_name varchar2(40) default '' NOT NULL, @@ -275,6 +357,9 @@ PRIMARY KEY (database_id) ); + +#-- +# TBL_SITE CREATE TABLE TBL_SITE ( site_id number(3) default '0' NOT NULL, site_name varchar2(50) default '' NOT NULL, @@ -282,33 +367,51 @@ PRIMARY KEY (site_id) ); + +# +# -- Insert initial data -- +# + INSERT INTO TBL_AUTH_USER (user_id, login, first_name, last_name, email, password) - values (1, 'OPTION_ADMIN_EMAIL', 'System', 'Admin', 'OPTION_ADMIN_EMAIL', - 'OPTION_ADMIN_PASS'); + values (1, 'OPTION_ADMIN_EMAIL', 'System', 'Admin', + 'OPTION_ADMIN_EMAIL', 'OPTION_ADMIN_PASS'); + CREATE SEQUENCE TBL_AUTH_USER_seq START WITH 2 NOCACHE; --- Start off with three user levels... + +# Start off with three user levels... INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (1, 'Admin', 1); INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (2, 'User', 1); INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked, assignable) VALUES (3, 'Developer', 1, 1); + CREATE SEQUENCE TBL_AUTH_GROUP_seq START WITH 4 NOCACHE; --- ... and only two permissions + +# ... and only two permissions INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (1, 'Admin'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (2, 'Editbug'); --- Admins can do all the admin stuff and users can edit bugs + +# Admins can do all the admin stuff, and INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (1, 1); + +# users can edit bugs INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (2, 2); --- And user_id 1 is an admin and a user + +# Insert user_id 1 into the admin group INSERT INTO TBL_USER_GROUP (user_id, group_id) VALUES (1, 1); -INSERT INTO TBL_USER_GROUP (user_id, group_id) VALUES (1, 2); --- Add user's prefs as default values for all users defined so far (only admin) + +# Add user's prefs as default values for all users defined so far (only admin) INSERT INTO TBL_USER_PREF (user_id) values (1); + +# +# -- Initialize the CONFIGURATION table -- +# + INSERT INTO TBL_CONFIGURATION VALUES ('INSTALL_URL','OPTION_INSTALL_URL','The base URL of the phpBugTracker installation','string'); INSERT INTO TBL_CONFIGURATION VALUES ('JPGRAPH_PATH','','If not in the include path. This is the file path on the web server, not a URL.','string'); INSERT INTO TBL_CONFIGURATION VALUES ('CVS_WEB','http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/phpbt/phpbt/','Location of your cvs web interface (see format_comments() in bug.php)','string'); @@ -341,6 +444,11 @@ INSERT INTO TBL_CONFIGURATION VALUES ('BUG_CLOSED','7','The status to assign a bug when it is closed.','multi'); INSERT INTO TBL_CONFIGURATION VALUES ('EMAIL_DISABLED', '0', 'Whether to disable all mail sent from the system', 'bool'); + +# +# -- Initialize the OS table -- +# + INSERT INTO TBL_OS VALUES (1,'All',1,''); INSERT INTO TBL_OS VALUES (2,'Windows 3.1',2,'/Mozilla.*\\(Win16.*\\)/'); INSERT INTO TBL_OS VALUES (3,'Windows 95',3,'/Mozilla.*\\(.*;.*; 32bit.*\\)/'); @@ -372,16 +480,28 @@ INSERT INTO TBL_OS VALUES (29,'Solaris',29,'/Mozilla.*\\(.*;.*; SunOS 5.*\\)/'); INSERT INTO TBL_OS VALUES (30,'SunOS',30,'/Mozilla.*\\(.*;.*; SunOS.*\\)/'); INSERT INTO TBL_OS VALUES (31,'other',31,''); + CREATE SEQUENCE TBL_OS_seq START WITH 32 NOCACHE; + +# +# -- Initialize the RESOLUTION table -- +# + INSERT INTO TBL_RESOLUTION VALUES (1,'Fixed','Bug was eliminated',1); INSERT INTO TBL_RESOLUTION VALUES (2,'Not a bug','It''s not a bug -- it''s a feature!',2); INSERT INTO TBL_RESOLUTION VALUES (3,'Won''t Fix','This bug will stay',3); INSERT INTO TBL_RESOLUTION VALUES (4,'Deferred','We''ll get around to it later',4); INSERT INTO TBL_RESOLUTION VALUES (5,'Works for me','Can''t replicate the bug',5); INSERT INTO TBL_RESOLUTION VALUES (6,'Duplicate','',6); + CREATE SEQUENCE TBL_RESOLUTION_seq START WITH 7 NOCACHE; + +# +# -- Initialize the SEVERITY table -- +# + INSERT INTO TBL_SEVERITY VALUES (1,'Unassigned','Default bug creation',1,'#dadada'); INSERT INTO TBL_SEVERITY VALUES (2,'Idea','Ideas for further development',2,'#dad0d0'); INSERT INTO TBL_SEVERITY VALUES (3,'Feature Request','Requests for specific features',3,'#dacaca'); @@ -389,8 +509,14 @@ INSERT INTO TBL_SEVERITY VALUES (5,'Content','Non-functional related bugs, such as text content',5,'#dababa'); INSERT INTO TBL_SEVERITY VALUES (6,'Significant','A bug affecting the intended performance of the product',6,'#dab0b0'); INSERT INTO TBL_SEVERITY VALUES (7,'Critical','A bug severe enough to prevent the release of the product',7,'#daaaaa'); + CREATE SEQUENCE TBL_SEVERITY_seq START WITH 8 NOCACHE; + +# +# -- Initialize the STATUS table -- +# + INSERT INTO TBL_STATUS VALUES (1,'Unconfirmed','Reported but not confirmed',1); INSERT INTO TBL_STATUS VALUES (2,'New','A new bug',2); INSERT INTO TBL_STATUS VALUES (3,'Assigned','Assigned to a developer',3); @@ -398,23 +524,43 @@ INSERT INTO TBL_STATUS VALUES (5,'Resolved','Set by engineer with a resolution',5); INSERT INTO TBL_STATUS VALUES (6,'Verified','The resolution is confirmed by the reporter',6); INSERT INTO TBL_STATUS VALUES (7,'Closed','The bug is officially squashed (QA)',7); + CREATE SEQUENCE TBL_STATUS_seq START WITH 8 NOCACHE; + +# +# -- Initialize the DATABASE table -- +# + INSERT INTO TBL_DATABASE VALUES (1,'Oracle 8.1.7',1); INSERT INTO TBL_DATABASE VALUES (2,'MySQL 3.23.49',2); INSERT INTO TBL_DATABASE VALUES (3,'PostgreSQL 7.1.3',3); + CREATE SEQUENCE TBL_DATABASE_seq START WITH 4 NOCACHE; + +# +# -- Initialize the SITE table -- +# + +# Examples only INSERT INTO TBL_SITE VALUES (0,'All',1); INSERT INTO TBL_SITE VALUES (1,'Production - location 1',2); INSERT INTO TBL_SITE VALUES (2,'Production - location 2',3); INSERT INTO TBL_SITE VALUES (3,'Test site - location 1',4); INSERT INTO TBL_SITE VALUES (4,'Test site - location 2',5); + CREATE SEQUENCE TBL_SITE_seq START WITH 5 NOCACHE; --- Sequences for the tables with no initial entries + +# +# -- Sequences for the tables with no initial entries -- +# + CREATE SEQUENCE TBL_BUG_seq START WITH 1 NOCACHE; CREATE SEQUENCE TBL_COMMENT_seq START WITH 1 NOCACHE; CREATE SEQUENCE TBL_COMPONENT_seq START WITH 1 NOCACHE; CREATE SEQUENCE TBL_PROJECT_seq START WITH 1 NOCACHE; CREATE SEQUENCE TBL_VERSION_seq START WITH 1 NOCACHE; + +#-- Index: pgsql.in =================================================================== RCS file: /cvsroot/phpbt/phpbt/schemas/pgsql.in,v retrieving revision 1.48 retrieving revision 1.49 diff -u -r1.48 -r1.49 --- pgsql.in 20 Jun 2005 01:05:29 -0000 1.48 +++ pgsql.in 23 Aug 2005 21:09:42 -0000 1.49 @@ -1,12 +1,12 @@ - --- PostgreSQL database creation script --- This is a template for install.php -- not for creating the database! --- --- $Id$ +# PostgreSQL database creation script +# This is a template for install.php -- not for creating the database! +# +# $Id$ BEGIN; - +#-- +# TBL_ATTACHMENT CREATE TABLE TBL_ATTACHMENT ( attachment_id INT4 NOT NULL DEFAULT '0', bug_id INT4 NOT NULL DEFAULT '0', @@ -19,6 +19,9 @@ PRIMARY KEY (attachment_id) ); + +#-- +# TBL_AUTH_GROUP CREATE TABLE TBL_AUTH_GROUP ( group_id INT4 NOT NULL DEFAULT '0', group_name varchar(80) NOT NULL DEFAULT '', @@ -31,6 +34,9 @@ PRIMARY KEY (group_id) ); + +#-- +# TBL_AUTH_PERM CREATE TABLE TBL_AUTH_PERM ( perm_id INT4 NOT NULL DEFAULT '0', perm_name varchar(80) NOT NULL DEFAULT '', @@ -41,6 +47,9 @@ PRIMARY KEY (perm_id) ); + +#-- +# TBL_AUTH_USER CREATE TABLE TBL_AUTH_USER ( user_id INT4 NOT NULL DEFAULT '0', login varchar(40) NOT NULL DEFAULT '', @@ -57,6 +66,9 @@ PRIMARY KEY (user_id) ); + +#-- +# TBL_BUG CREATE TABLE TBL_BUG ( bug_id INT4 NOT NULL DEFAULT '0', title varchar(100) NOT NULL DEFAULT '', @@ -84,6 +96,9 @@ PRIMARY KEY (bug_id) ); + +#-- +# TBL_BUG_CC CREATE TABLE TBL_BUG_CC ( bug_id INT4 NOT NULL DEFAULT '0', user_id INT4 NOT NULL DEFAULT '0', @@ -92,18 +107,27 @@ PRIMARY KEY (bug_id,user_id) ); + +#-- +# TBL_BUG_DEPENDENCY CREATE TABLE TBL_BUG_DEPENDENCY ( bug_id INT4 NOT NULL DEFAULT '0', depends_on INT4 NOT NULL DEFAULT '0', PRIMARY KEY (bug_id,depends_on) ); + +#-- +# TBL_BUG_GROUP CREATE TABLE TBL_BUG_GROUP ( bug_id INT4 NOT NULL DEFAULT '0', group_id INT4 NOT NULL DEFAULT '0', PRIMARY KEY (bug_id,group_id) ); + +#-- +# TBL_BUG_HISTORY CREATE TABLE TBL_BUG_HISTORY ( bug_id INT4 NOT NULL DEFAULT '0', changed_field varchar(30) NOT NULL DEFAULT '', @@ -113,6 +137,9 @@ created_date INT8 NOT NULL DEFAULT '0' ); + +#-- +# TBL_BUG_VOTE CREATE TABLE TBL_BUG_VOTE ( user_id INT4 NOT NULL DEFAULT '0', bug_id INT4 NOT NULL DEFAULT '0', @@ -120,6 +147,9 @@ PRIMARY KEY (user_id,bug_id) ); + +#-- +# TBL_COMMENT CREATE TABLE TBL_COMMENT ( comment_id INT4 NOT NULL DEFAULT '0', bug_id INT4 NOT NULL DEFAULT '0', @@ -129,6 +159,9 @@ PRIMARY KEY (comment_id) ); + +#-- +# TBL_COMPONENT CREATE TABLE TBL_COMPONENT ( component_id INT4 NOT NULL DEFAULT '0', project_id INT4 NOT NULL DEFAULT '0', @@ -143,6 +176,9 @@ PRIMARY KEY (component_id) ); + +#-- +# TBL_CONFIGURATION CREATE TABLE TBL_CONFIGURATION ( varname varchar(40) NOT NULL DEFAULT '', varvalue varchar(255) NOT NULL DEFAULT '', @@ -151,12 +187,28 @@ PRIMARY KEY (varname) ); + +#-- +# TBL_DATABASE +CREATE TABLE TBL_DATABASE ( + database_id INT2 NOT NULL DEFAULT '0', + database_name varchar(40) NOT NULL DEFAULT '', + sort_order INT2 NOT NULL DEFAULT '0', + PRIMARY KEY (database_id) +); + + +#-- +# TBL_GROUP_PERM CREATE TABLE TBL_GROUP_PERM ( group_id INT4 NOT NULL DEFAULT '0', perm_id INT4 NOT NULL DEFAULT '0', PRIMARY KEY (group_id,perm_id) ); + +#-- +# TBL_OS CREATE TABLE TBL_OS ( os_id INT4 NOT NULL DEFAULT '0', os_name varchar(30) NOT NULL DEFAULT '', @@ -165,6 +217,9 @@ PRIMARY KEY (os_id) ); + +#-- +# TBL_PROJECT CREATE TABLE TBL_PROJECT ( project_id INT4 NOT NULL DEFAULT '0', project_name varchar(30) NOT NULL DEFAULT '', @@ -177,6 +232,9 @@ PRIMARY KEY (project_id) ); + +#-- +# TBL_PROJECT_GROUP CREATE TABLE TBL_PROJECT_GROUP ( project_id INT4 NOT NULL DEFAULT '0', group_id INT4 NOT NULL DEFAULT '0', @@ -185,11 +243,17 @@ PRIMARY KEY (project_id,group_id) ); + +#-- +# TBL_PROJECT_PERM CREATE TABLE TBL_PROJECT_PERM ( project_id INT4 NOT NULL DEFAULT '0', user_id INT4 NOT NULL DEFAULT '0' ); + +#-- +# TBL_RESOLUTION CREATE TABLE TBL_RESOLUTION ( resolution_id INT4 NOT NULL DEFAULT '0', resolution_name varchar(30) NOT NULL DEFAULT '', @@ -199,6 +263,8 @@ ); +#-- +# TBL_SAVED_QUERY CREATE TABLE TBL_SAVED_QUERY ( saved_query_id INT4 DEFAULT '0', user_id INT4 NOT NULL DEFAULT '0', @@ -207,6 +273,9 @@ PRIMARY KEY (saved_query_id,user_id) ); + +#-- +# TBL_SEVERITY CREATE TABLE TBL_SEVERITY ( severity_id INT4 NOT NULL DEFAULT '0', severity_name varchar(30) NOT NULL DEFAULT '', @@ -216,6 +285,19 @@ PRIMARY KEY (severity_id) ); + +#-- +# TBL_SITE +CREATE TABLE TBL_SITE ( + site_id INT2 NOT NULL DEFAULT '0', + site_name varchar(50) NOT NULL DEFAULT '', + sort_order INT2 NOT NULL DEFAULT '0', + PRIMARY KEY (site_id) +); + + +#-- +# TBL_STATUS CREATE TABLE TBL_STATUS ( status_id INT4 NOT NULL DEFAULT '0', status_name varchar(30) NOT NULL DEFAULT '', @@ -225,6 +307,9 @@ PRIMARY KEY (status_id) ); + +#-- +# TBL_USER_GROUP CREATE TABLE TBL_USER_GROUP ( user_id INT4 NOT NULL DEFAULT '0', group_id INT4 NOT NULL DEFAULT '0', @@ -233,6 +318,9 @@ PRIMARY KEY (user_id,group_id) ); + +#-- +# TBL_USER_PERM CREATE TABLE TBL_USER_PERM ( user_id INT4 NOT NULL DEFAULT '0', perm_id INT4 NOT NULL DEFAULT '0', @@ -241,14 +329,20 @@ PRIMARY KEY (user_id,perm_id) ); + +#-- +# TBL_USER_PREF CREATE TABLE TBL_USER_PREF ( - user_id INT4 NOT NULL DEFAULT '0', - email_notices INT2 NOT NULL DEFAULT '1', - saved_queries INT2 NOT NULL DEFAULT '1', - def_results INT4 NOT NULL DEFAULT '20', - PRIMARY KEY (user_id) + user_id INT4 NOT NULL DEFAULT '0', + email_notices INT2 NOT NULL DEFAULT '1', + saved_queries INT2 NOT NULL DEFAULT '1', + def_results INT4 NOT NULL DEFAULT '20', + PRIMARY KEY (user_id) ); + +#-- +# TBL_VERSION CREATE TABLE TBL_VERSION ( version_id INT4 NOT NULL DEFAULT '0', project_id INT4 NOT NULL DEFAULT '0', @@ -261,52 +355,53 @@ PRIMARY KEY (version_id) ); -CREATE TABLE TBL_DATABASE ( - database_id INT2 NOT NULL DEFAULT '0', - database_name varchar(40) NOT NULL DEFAULT '', - sort_order INT2 NOT NULL DEFAULT '0', - PRIMARY KEY (database_id) -); -CREATE TABLE TBL_SITE ( - site_id INT2 NOT NULL DEFAULT '0', - site_name varchar(50) NOT NULL DEFAULT '', - sort_order INT2 NOT NULL DEFAULT '0', - PRIMARY KEY (site_id) -); +# +# -- Insert initial data -- +# --- --- -- Insert initial data -- --- INSERT INTO TBL_AUTH_USER (user_id, login, first_name, last_name, email, password) - values (1, 'OPTION_ADMIN_EMAIL', 'System', 'Admin', 'OPTION_ADMIN_EMAIL', - 'OPTION_ADMIN_PASS'); + values (1, 'OPTION_ADMIN_EMAIL', 'System', 'Admin', + 'OPTION_ADMIN_EMAIL', 'OPTION_ADMIN_PASS'); + CREATE SEQUENCE TBL_AUTH_USER_seq START 2; --- Start off with three user levels... + +# Start off with three user levels... INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (1, 'Admin', 1); INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (2, 'User', 1); INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked, assignable) VALUES (3, 'Developer', 1, 1); + CREATE SEQUENCE TBL_AUTH_GROUP_seq START 4; --- ... and only two permissions + +# ... and three permissions INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (1, 'Admin'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (2, 'Editbug'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (3, 'EditAssignment'); --- Admins can do all the admin stuff and users can edit bugs + +# Admins can do all the admin stuff, and INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (1, 1); + +# users can edit bugs INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (2, 2); --- And user_id 1 is an admin and a user + +# Insert user_id 1 into the admin group INSERT INTO TBL_USER_GROUP (user_id, group_id) VALUES (1, 1); -INSERT INTO TBL_USER_GROUP (user_id, group_id) VALUES (1, 2); --- Add user's prefs as default values for all users defined so far (only admin) + +# Add user's prefs as default values for all users defined so far (only admin) INSERT INTO TBL_USER_PREF (user_id) values (1); + +# +# -- Initialize the CONFIGURATION table -- +# + INSERT INTO TBL_CONFIGURATION VALUES ('INSTALL_URL','OPTION_INSTALL_URL','The base URL of the phpBugTracker installation','string'); INSERT INTO TBL_CONFIGURATION VALUES ('JPGRAPH_PATH','','If not in the include path. This is the file path on the web server, not a URL.','string'); INSERT INTO TBL_CONFIGURATION VALUES ('CVS_WEB','http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/phpbt/phpbt/','Location of your cvs web interface (see format_comments() in bug.php)','string'); @@ -338,6 +433,11 @@ INSERT INTO TBL_CONFIGURATION VALUES ('BUG_REOPENED','4','The status to assign a bug when it is reopened.','multi'); INSERT INTO TBL_CONFIGURATION VALUES ('EMAIL_DISABLED', '0', 'Whether to disable all mail sent from the system', 'bool'); + +# +# -- Initialize the OS table -- +# + INSERT INTO TBL_OS VALUES (1,'All',1,''); INSERT INTO TBL_OS VALUES (2,'Windows 3.1',2,'/Mozilla.*\\(Win16.*\\)/'); INSERT INTO TBL_OS VALUES (3,'Windows 95',3,'/Mozilla.*\\(.*;.*; 32bit.*\\)/'); @@ -369,16 +469,28 @@ INSERT INTO TBL_OS VALUES (29,'Solaris',29,'/Mozilla.*\\(.*;.*; SunOS 5.*\\)/'); INSERT INTO TBL_OS VALUES (30,'SunOS',30,'/Mozilla.*\\(.*;.*; SunOS.*\\)/'); INSERT INTO TBL_OS VALUES (31,'other',31,''); + CREATE SEQUENCE TBL_OS_seq START 32; + +# +# -- Initialize the RESOLUTION table -- +# + INSERT INTO TBL_RESOLUTION VALUES (1,'Fixed','Bug was eliminated',1); INSERT INTO TBL_RESOLUTION VALUES (2,'Not a bug','It''s not a bug -- it''s a feature!',2); INSERT INTO TBL_RESOLUTION VALUES (3,'Won''t Fix','This bug will stay',3); INSERT INTO TBL_RESOLUTION VALUES (4,'Deferred','We''ll get around to it later',4); INSERT INTO TBL_RESOLUTION VALUES (5,'Works for me','Can''t replicate the bug',5); INSERT INTO TBL_RESOLUTION VALUES (6,'Duplicate','',6); + CREATE SEQUENCE TBL_RESOLUTION_seq START 7; + +# +# -- Initialize the SEVERITY table -- +# + INSERT INTO TBL_SEVERITY VALUES (1,'Unassigned','Default bug creation',1,'#dadada'); INSERT INTO TBL_SEVERITY VALUES (2,'Idea','Ideas for further development',2,'#dad0d0'); INSERT INTO TBL_SEVERITY VALUES (3,'Feature Request','Requests for specific features',3,'#dacaca'); @@ -386,8 +498,14 @@ INSERT INTO TBL_SEVERITY VALUES (5,'Content','Non-functional related bugs, such as text content',5,'#dababa'); INSERT INTO TBL_SEVERITY VALUES (6,'Significant','A bug affecting the intended performance of the product',6,'#dab0b0'); INSERT INTO TBL_SEVERITY VALUES (7,'Critical','A bug severe enough to prevent the release of the product',7,'#daaaaa'); + CREATE SEQUENCE TBL_SEVERITY_seq START 8; + +# +# -- Initialize the STATUS table -- +# + INSERT INTO TBL_STATUS VALUES (1,'Unconfirmed','Reported but not confirmed',1,1); INSERT INTO TBL_STATUS VALUES (2,'New','A new bug',2,1); INSERT INTO TBL_STATUS VALUES (3,'Assigned','Assigned to a developer',3,1); @@ -395,53 +513,55 @@ INSERT INTO TBL_STATUS VALUES (5,'Resolved','Set by engineer with a resolution',5,0); INSERT INTO TBL_STATUS VALUES (6,'Verified','The resolution is confirmed by the reporter',6,0); INSERT INTO TBL_STATUS VALUES (7,'Closed','The bug is officially squashed (QA)',7,0); + CREATE SEQUENCE TBL_STATUS_seq START 8; + +# +# -- Initialize the DATABASE table -- +# + INSERT INTO TBL_DATABASE VALUES (1,'Oracle 8.1.7',1); INSERT INTO TBL_DATABASE VALUES (2,'MySQL 3.23.49',2); INSERT INTO TBL_DATABASE VALUES (3,'PostgreSQL 7.1.3',3); + CREATE SEQUENCE TBL_DATABASE_seq START 4; + +# +# -- Initialize the SITE table -- +# + +# Examples only INSERT INTO TBL_SITE VALUES (0,'All',1); INSERT INTO TBL_SITE VALUES (1,'Production - location 1',2); INSERT INTO TBL_SITE VALUES (2,'Production - location 2',3); INSERT INTO TBL_SITE VALUES (3,'Test site - location 1',4); INSERT INTO TBL_SITE VALUES (4,'Test site - location 2',5); -CREATE SEQUENCE TBL_SITE_seq START 5; --- --- Indexes for table TBL_GROUP_PERM --- +CREATE SEQUENCE TBL_SITE_seq START 5; -CREATE INDEX perm_id_TBL_GROUP_PERM_index ON TBL_GROUP_PERM (perm_id); --- --- Indexes for table TBL_USER_GROUP --- +# +# -- Create indexes -- +# +CREATE INDEX perm_id_TBL_GROUP_PERM_index ON TBL_GROUP_PERM (perm_id); CREATE INDEX group_id_TBL_USER_GROUP_index ON TBL_USER_GROUP (group_id); - --- --- Indexes for table TBL_USER_PERM --- - CREATE INDEX perm_id_TBL_USER_PERM_index ON TBL_USER_PERM (perm_id); +CREATE INDEX group_id_TBL_BUG_GROUP_index ON TBL_BUG_GROUP (group_id); --- --- Indexes for table TBL_BUG_GROUP --- -CREATE INDEX group_id_TBL_BUG_GROUP_index ON TBL_BUG_GROUP (group_id); +# +# -- Sequences for the tables with no initial entries -- +# --- Sequences for the tables with no initial entries --- CREATE SEQUENCE TBL_BUG_seq; CREATE SEQUENCE TBL_COMMENT_seq; CREATE SEQUENCE TBL_COMPONENT_seq; CREATE SEQUENCE TBL_PROJECT_seq; CREATE SEQUENCE TBL_VERSION_seq; --- +#-- COMMIT; - |