|
From: Benjamin C. <bc...@us...> - 2002-03-07 00:35:41
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv16986
Modified Files:
upgrade.php UPGRADING
Log Message:
Changes for 0.7.0
Index: upgrade.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/upgrade.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- upgrade.php 7 Mar 2002 00:30:28 -0000 1.7
+++ upgrade.php 7 Mar 2002 00:35:38 -0000 1.8
@@ -28,20 +28,17 @@
function upgrade() {
global $q;
- $upgraded = $q->grab_field("select nextid from ". TBL_DB_SEQUENCE.
- ' where seq_name = "'.TBL_AUTH_GROUP.'"');
+ $upgraded = $q->grab_field('select varvalue from '.TBL_CONFIGURATION.
+ ' where varname = "PROMOTE_VOTES"');
if (!$upgraded) {
- // Make changes to the auth_group table
- $q->query('alter table '.TBL_AUTH_GROUP.' add locked tinyint(1) not null default 0 after group_name');
- $q->query('update '.TBL_AUTH_GROUP.' set locked = 1');
- $q->query("insert into ".TBL_DB_SEQUENCE." values('".TBL_AUTH_GROUP."', 3)");
-
- // New table
+ // Add the bug_vote table and insert the new configuration options
if (DB_TYPE == 'pgsql') {
- $q->query("CREATE TABLE ".TBL_PROJECT_GROUP." ( project_id INT4 NOT NULL DEFAULT '0', group_id INT4 NOT NULL DEFAULT '0', created_by INT4 NOT NULL DEFAULT '0', created_date INT8 NOT NULL DEFAULT '0', PRIMARY KEY (project_id,group_id) )");
+ $q->query("CREATE TABLE ".TBL_BUG_VOTE." ( user_id INT4 NOT NULL DEFAULT '0', bug_id INT4 NOT NULL DEFAULT '0', created_date INT8 NOT NULL DEFAULT '0', PRIMARY KEY (user_id,bug_id) );");
} else {
- $q->query("create table ".TBL_PROJECT_GROUP." ( project_id int(10) unsigned NOT NULL default '0', group_id int(10) unsigned NOT NULL default '0', created_by int(10) unsigned NOT NULL default '0', created_date bigint(20) unsigned NOT NULL default '0', PRIMARY KEY (project_id,group_id), KEY group_id (group_id) )");
+ $q->query("create table ".TBL_BUG_VOTE." ( user_id int(10) unsigned NOT NULL default '0', bug_id int(10) unsigned NOT NULL default '0', created_date bigint(20) unsigned NOT NULL default '0', PRIMARY KEY (user_id, bug_id), KEY bug_id (bug_id) )");
}
+ $q->query("INSERT INTO TBL_CONFIGURATION VALUES ('PROMOTE_VOTES', 5, 'The number of votes required to promote a bug from Unconfirmed to New (Set to 0 to disable promotions by voting)', 'string')");
+ $q->query("INSERT INTO TBL_CONFIGURATION VALUES ('MAX_USER_VOTES', 5, 'The maximum number of votes a user can cast across all bugs (Set to 0 to have no limit)', 'string')");
}
include 'templates/default/upgrade-finished.html';
}
Index: UPGRADING
===================================================================
RCS file: /cvsroot/phpbt/phpbt/UPGRADING,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- UPGRADING 15 Dec 2001 18:45:19 -0000 1.5
+++ UPGRADING 7 Mar 2002 00:35:38 -0000 1.6
@@ -1,4 +1,4 @@
-Upgrading from 0.5.1 to 0.6.0
+Upgrading from 0.6.x to 0.7.0
-----------------------------
A new table, project_group, has been added, and the auth_group table has been
|