|
From: Ulf E. <ulf...@us...> - 2005-08-29 19:09:49
|
Update of /cvsroot/phpbt/phpbt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15911 Modified Files: config-dist.php include.php install.php upgrade.php Log Message: Upgrade script for phpBT 1.0 to phpBT-devel (MySQL only) Index: config-dist.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/config-dist.php,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- config-dist.php 22 Aug 2005 20:54:43 -0000 1.34 +++ config-dist.php 29 Aug 2005 19:09:39 -0000 1.35 @@ -30,7 +30,7 @@ // Database Table Config // you can change either the prefix of the table names or each table name individually -define ('CUR_DB_VERSION', 4); // the version of the database +define ('CUR_DB_VERSION', 5); // the version of the database define ('TBL_PREFIX', '{tbl_prefix}'); // the prefix for all tables, leave empty to use the old style define ('TBL_ACTIVE_SESSIONS', TBL_PREFIX.'active_sessions'); Index: include.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/include.php,v retrieving revision 1.139 retrieving revision 1.140 diff -u -r1.139 -r1.140 --- include.php 22 Aug 2005 20:50:23 -0000 1.139 +++ include.php 29 Aug 2005 19:09:40 -0000 1.140 @@ -80,6 +80,11 @@ } } +else { + if (!defined('OPEN_BUG_STATUSES')) define('OPEN_BUG_STATUSES', '0'); + if (!defined('CHARSET')) define('CHARSET', 'utf-8'); + if (!defined('STYLE')) define('STYLE', 'default'); +} require_once ('inc/db/'.DB_TYPE.'.php'); $me = $HTTP_SERVER_VARS['PHP_SELF']; Index: install.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/install.php,v retrieving revision 1.51 retrieving revision 1.52 diff -u -r1.51 -r1.52 --- install.php 23 Aug 2005 21:26:14 -0000 1.51 +++ install.php 29 Aug 2005 19:09:40 -0000 1.52 @@ -225,7 +225,7 @@ $do_query = ''; } /*!! BAD! Must figure out how to get db_version from config-dist.php... */ - $query = preg_replace(array_keys($tables), array_values($tables), 'INSERT INTO TBL_CONFIGURATION (varname,varvalue,description,vartype) VALUES (\'DB_VERSION\', './*!!!*/4/*!!!*/.', \'Database Version <b>Warning:</b> Changing this might make things go horribly wrong, so don\\\'t change it.\', \'mixed\')'); + $query = preg_replace(array_keys($tables), array_values($tables), 'INSERT INTO TBL_CONFIGURATION (varname,varvalue,description,vartype) VALUES (\'DB_VERSION\', './*!!!*/5/*!!!*/.', \'Database Version <b>Warning:</b> Changing this might make things go horribly wrong, so don\\\'t change it.\', \'mixed\')'); log_query($query); if ($num_errors > 0) { Index: upgrade.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/upgrade.php,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- upgrade.php 19 Jul 2005 19:25:37 -0000 1.41 +++ upgrade.php 29 Aug 2005 19:09:40 -0000 1.42 @@ -23,7 +23,6 @@ // $Id$ define ('NO_AUTH', 1); -define ('RAWERROR', true); define ('THEME', 'default'); $upgrading = true; include 'include.php'; @@ -97,6 +96,7 @@ $log_text = $tmp_log; + $upgraded = 0; if ($thisvers == CUR_DB_VERSION) $upgraded = 1; if (!$upgraded) { switch(DB_TYPE) { @@ -120,6 +120,8 @@ log_query("update ".TBL_STATUS." set bug_open = 1"); log_query("ALTER TABLE ".TBL_STATUS." alter bug_open set NOT NULL"); } + if ($thisvers < 5) { + } break; case 'mysqli' : case 'mysql' : @@ -133,6 +135,14 @@ if ($thisvers < 4) { log_query('ALTER TABLE '.TBL_STATUS.' ADD bug_open TINYINT DEFAULT \'1\' NOT NULL'); } + if ($thisvers < 5) { + log_query("create table if not exists ".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) )"); + log_query("create table if not exists ".TBL_BOOKMARK." ( user_id int(10) unsigned NOT NULL default '0', bug_id int(10) unsigned NOT NULL default '0' )"); + log_query("alter table ".TBL_COMPONENT." ADD sort_order tinyint(3) unsigned NOT NULL default '0' AFTER active"); + log_query("alter table ".TBL_VERSION." ADD sort_order tinyint(3) unsigned NOT NULL default '0' AFTER active"); + log_query("CREATE TABLE IF NOT EXISTS ".TBL_PRIORITY."_seq (id int unsigned auto_increment not null primary key)"); + log_query("INSERT INTO ".TBL_PRIORITY."_seq values (5)"); + } break; case 'oci8' : if (true) { @@ -154,6 +164,8 @@ if ($thisvers < 4) { log_query("ALTER TABLE ".TBL_STATUS." ADD (bug_open number(1) default '1' NOT NULL)"); } + if ($thisvers < 5) { + } break; } @@ -172,6 +184,17 @@ log_query("INSERT INTO ".TBL_AUTH_PERM." (perm_id, perm_name) VALUES (3, 'EditAssignment')"); } + if ($thisvers < 5) { + log_query("INSERT INTO ".TBL_AUTH_PERM." (perm_id, perm_name) VALUES (4, 'Assignable')"); + $comment_text .= "You must set your developer group(s) to be Assignable by visiting the \"Groups\" page within the Administration Pages.<br><br>\n"; + log_query("INSERT INTO ".TBL_CONFIGURATION." VALUES ('USE_PRIORITY_COLOR','0','Should the query list use the priority colors as the row background color','bool')"); + log_query("INSERT INTO ".TBL_PRIORITY." VALUES (1,'Low','Fix if possible',1,'#dadada')"); + log_query("INSERT INTO ".TBL_PRIORITY." VALUES (2,'Medium Low','Must fix before final',2,'#dad0d0')"); + log_query("INSERT INTO ".TBL_PRIORITY." VALUES (3,'Medium','Fix before next milestone (alpha, beta, etc.)',3,'#dac0c0')"); + log_query("INSERT INTO ".TBL_PRIORITY." VALUES (4,'Medium High','Fix as soon as possible',4,'#dab0b0')"); + log_query("INSERT INTO ".TBL_PRIORITY." VALUES (5,'High','Fix immediately',5,'#daaaaa')"); + } + /* update to current DB_VERSION */ log_query("UPDATE ".TBL_CONFIGURATION." SET varvalue = '".CUR_DB_VERSION."' WHERE varname = 'DB_VERSION'"); if ($num_errors == 0) { |