|
From: Benjamin C. <bc...@us...> - 2004-05-07 13:05:08
|
Update of /cvsroot/phpbt/phpbt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26029 Modified Files: Tag: htmltemplates upgrade.php Log Message: Getting ready for 1.0. I don't have the resources to test oracle support, so notify users that oracle support is going away. Index: upgrade.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/upgrade.php,v retrieving revision 1.35 retrieving revision 1.35.2.1 diff -u -r1.35 -r1.35.2.1 --- upgrade.php 24 Jul 2003 04:47:13 -0000 1.35 +++ upgrade.php 7 May 2004 13:04:58 -0000 1.35.2.1 @@ -2,7 +2,7 @@ // upgrade.php -- Upgrade from the previous version // ------------------------------------------------------------------------ -// Copyright (c) 2001, 2002 The phpBugTracker Group +// Copyright (c) 2001 - 2004 The phpBugTracker Group // ------------------------------------------------------------------------ // This file is part of phpBugTracker // @@ -32,14 +32,27 @@ $thisvers = $db->getOne('select varvalue from '.TBL_CONFIGURATION.' where varname = \'DB_VERSION\''); if ($thisvers == DB_VERSION) $upgraded = 1; if (!$upgraded or DB::isError($thisvers)) { - if (!@is_writeable('c_templates')) { - include('templates/default/base/templatesperm.html'); - exit; - } switch(DB_TYPE) { case 'pgsql' : $db->query("create table ".TBL_PROJECT_PERM." ( project_id INT4 NOT NULL DEFAULT '0', user_id INT4 NOT NULL DEFAULT '0' )"); - //! TBL_AUTH_GROUP + if ($thisvers < 2) { + $db->query("alter table ".TBL_AUTH_GROUP." ADD assignable INT2"); + $db->query("alter table ".TBL_AUTH_GROUP." alter assignable set DEFAULT 0"); + $db->query("update ".TBL_AUTH_GROUP." set assignable = 0"); + $db->query("alter table ".TBL_AUTH_GROUP." alter assignable set NOT NULL"); + } + if ($thisvers < 3) { + $db->query("ALTER TABLE ".TBL_USER_PREF." ADD def_results INT4"); + $db->query("ALTER TABLE ".TBL_USER_PREF." alter def_results set DEFAULT 20"); + $db->query("update ".TBL_USER_PREF." set def_results = 20"); + $db->query("ALTER TABLE ".TBL_USER_PREF." alter def_results set NOT NULL"); + } + if ($thisvers < 4) { + $db->query('ALTER TABLE '.TBL_STATUS.' ADD bug_open INT2'); + $db->query("ALTER TABLE ".TBL_STATUS." alter bug_open set DEFAULT 1"); + $db->query("update ".TBL_STATUS." set bug_open = 1"); + $db->query("ALTER TABLE ".TBL_STATUS." alter bug_open set NOT NULL"); + } break; case 'mysql' : $db->query("create table if not exists ".TBL_PROJECT_PERM." ( project_id int(11) NOT NULL default '0', user_id int(11) NOT NULL default '0' )"); @@ -53,9 +66,9 @@ $db->query('ALTER TABLE '.TBL_STATUS.' ADD bug_open TINYINT DEFAULT \'1\' NOT NULL'); } break; - case 'pgsql' : - //! Missing Alter/Create's case 'oci8' : + echo "Oracle is not supported in version 1.0" + exit; $db->query("create table ".TBL_PROJECT_PERM." ( project_id number(10) default '0' NOT NULL, user_id number(10) default '0' NOT NULL )"); //! TBL_AUTH_GROUP //! TBL_USER_PERM.def_results (see mysql) @@ -74,6 +87,7 @@ if ($thisvers < 4) { $db->query('DELETE FROM '.TBL_CONFIGURATION.' WHERE varname = \'BUG_CLOSED\''); echo 'You must set your Statuses to either open or closed. Default settings should be modified so that "resolved", "closed", and "verified" are shown as being closed, and all other statuses are set to open.'; + $db->query("INSERT INTO ".TBL_AUTH_PERM." (perm_id, perm_name) VALUES (3, 'EditAssignment')"); } /* update to current DB_VERSION */ |