[whups] MyBugs and Summary don't work, too

Christoph Schindler e9525429 at student.tuwien.ac.at
Thu Jul 3 13:38:42 PDT 2003


On Thu, Jul 03, 2003 at 08:09:26AM -0400, Chuck Hagenbuch wrote:
> Quoting Christoph Schindler <e9525429 at student.tuwien.ac.at>:
> 
> > I have a similar problem to the previous post...
> >
> > The problem is that I use postgres, not mysql.
> 
> Same problem, same solution. Your db has nothing to do with it.

Ahm... thing is: i did not upgrade, I made a fresh install of whups, so
where should i migrate from?

Also, I see no other tables but whups_* altered in that script, or have
I overlooked something?

Neither the whups.sql nor the migration script works with postgres, of
course, but i have attached my patches...
Maybe my error lies there.. especially about the INDEXes on the
whups_ticket_owners table, I'm not sure.

> > I noticed that there is not entry for postgres in conf.xml, so probably
> > there is no support yet, correct?
> 
> Incorrect. It works fine.

Maybe i have made a mistake in the selfmade conf.php (since i cannot
create one via the administrator interface, of course)?

<?php
$conf['projects']['driver'] = 'sql';
$conf['projects']['params']['phptype'] = 'pgsql';
$conf['projects']['params']['protocol'] = 'unix';
$conf['projects']['params']['hostspec'] = 'localhost';
$conf['projects']['params']['username'] = 'horde';
$conf['projects']['params']['password'] = '******';
$conf['projects']['params']['database'] = 'horde_head';
$conf['projects']['params']['charset'] = 'iso-8859-1';
$conf['prefs']['autolink_terms'] = 'bug|ticket|issue';
$conf['mail']['contact_addr'] = 'Whups Administrator <root at localhost>';
$conf['mail']['commenthistory'] = 'new';
$conf['mail']['oncreate'] = array('requester');
$conf['mail']['oncomment'] = array('owner');
$conf['mail']['onassign'] = array('owner');
$conf['mail']['onstate'] = array();
$conf['mail']['onpriority'] = array();
$conf['mail']['ontype'] = array();
$conf['menu']['apps'] = array();

> 
> -chuck
> 
> --
> Charles Hagenbuch, <chuck at horde.org>
> The alligators were there, too, in a bathtub inside the house.
> 

Thanks, hop.

-- 
pathological-techno-fetishist-with-social-deficit
-------------- next part --------------
--- migrate_owners.php	2003-07-02 23:44:53.000000000 +0200
+++ migrate_owners_pg.php	2003-07-03 22:37:25.000000000 +0200
@@ -33,10 +33,7 @@
 // Create new table
 $sql = "CREATE TABLE whups_ticket_owners (
     ticket_id           INT NOT NULL,
-    ticket_owner        VARCHAR(255) NOT NULL,
-
-    KEY (ticket_id),
-    KEY (ticket_owner)
+    ticket_owner        VARCHAR(255) NOT NULL
 );";
 
 $result = $db->query($sql);
@@ -45,14 +42,36 @@
     $output .= $result->toString() . "\n\n";
 }
 
+$sql = "CREATE INDEX ticket_id_idx ON TABLE whups_ticket_owners (ticket_id)"
+$result = $db->query($sql);
+if (is_a($result, 'PEAR_Error')) {
+    $output .= "Could not create index for ticket_id on table whups_ticket_owners.\n";
+    $output .= $result->toString() . "\n\n";
+}
+
+$sql = "CREATE INDEX ticket_owner_idx ON TABLE whups_ticket_owners (ticket_owner)"
+$result = $db->query($sql);
+if (is_a($result, 'PEAR_Error')) {
+    $output .= "Could not create index for ticket_owner on table whups_ticket_owners.\n";
+    $output .= $result->toString() . "\n\n";
+}
+
+
 // Add new field to whups_logs table
-$sql = "ALTER TABLE whups_logs ADD COLUMN user_id VARCHAR(255) NOT NULL";
+$sql = "ALTER TABLE whups_logs ADD COLUMN user_id VARCHAR(255)";
 $result = $db->query($sql);
 if (is_a($result, 'PEAR_Error')) {
     $output .= "Could not add new column to table whups_logs.\n";
     $output .= $result->toString() . "\n\n";
 }
 
+$sql = "ALTER TABLE whups_logs ALTER COLUMN user_id SET NOT NULL";
+$result = $db->query($sql);
+if (is_a($result, 'PEAR_Error')) {
+    $output .= "Could not set new column to `not null' in table whups_logs.\n";
+    $output .= $result->toString() . "\n\n";
+}
+
 // Logs.
 $sql = "UPDATE whups_logs SET user_id = user_id_owner ";
 $result = $db->query($sql);
-------------- next part --------------
--- whups.sql	2003-07-03 20:20:52.000000000 +0200
+++ whups_pg.sql	2003-07-03 22:26:20.000000000 +0200
@@ -34,12 +34,12 @@
 
 CREATE TABLE whups_ticket_owners (
     ticket_id           INT NOT NULL,
-    ticket_owner        VARCHAR(255) NOT NULL,
-
-    KEY (ticket_id),
-    KEY (ticket_owner)
+    ticket_owner        VARCHAR(255) NOT NULL
 );
 
+CREATE INDEX ticket_id_idx ON whups_ticket_owners (ticket_id);
+CREATE INDEX ticket_owner_idx ON whups_ticket_owners (ticket_owner);
+
 CREATE TABLE whups_guests (
     guest_id            VARCHAR(255) NOT NULL,
     guest_email         VARCHAR(255) NOT NULL,
@@ -175,22 +175,22 @@
     user_uid        VARCHAR(255) NOT NULL
 );
 
-GRANT SELECT, INSERT, UPDATE, DELETE ON whups_db_version TO horde at localhost;
-GRANT SELECT, INSERT, UPDATE, DELETE ON whups_tickets TO horde at localhost;
-GRANT SELECT, INSERT, UPDATE, DELETE ON whups_guests TO horde at localhost;
-GRANT SELECT, INSERT, UPDATE, DELETE ON whups_modules TO horde at localhost;
-GRANT SELECT, INSERT, UPDATE, DELETE ON whups_modules_users TO horde at localhost;
-GRANT SELECT, INSERT, UPDATE, DELETE ON whups_subjects TO horde at localhost;
-GRANT SELECT, INSERT, UPDATE, DELETE ON whups_modules_subjects TO horde at localhost;
-GRANT SELECT, INSERT, UPDATE, DELETE ON whups_types TO horde at localhost;
-GRANT SELECT, INSERT, UPDATE, DELETE ON whups_types_modules TO horde at localhost;
-GRANT SELECT, INSERT, UPDATE, DELETE ON whups_states TO horde at localhost;
-GRANT SELECT, INSERT, UPDATE, DELETE ON whups_attributes_desc TO horde at localhost;
-GRANT SELECT, INSERT, UPDATE, DELETE ON whups_attributes TO horde at localhost;
-GRANT SELECT, INSERT, UPDATE, DELETE ON whups_comments TO horde at localhost;
-GRANT SELECT, INSERT, UPDATE, DELETE ON whups_logs TO horde at localhost;
-GRANT SELECT, INSERT, UPDATE, DELETE ON whups_priorities TO horde at localhost;
-GRANT SELECT, INSERT, UPDATE, DELETE ON whups_versions TO horde at localhost;
-GRANT SELECT, INSERT, UPDATE, DELETE ON whups_users_searches TO horde at localhost;
-GRANT SELECT, INSERT, UPDATE, DELETE ON whups_users_queries TO horde at localhost;
-GRANT SELECT, INSERT, UPDATE, DELETE ON whups_tickets_listeners TO horde at localhost;
+GRANT SELECT, INSERT, UPDATE, DELETE ON whups_db_version TO horde;
+GRANT SELECT, INSERT, UPDATE, DELETE ON whups_tickets TO horde;
+GRANT SELECT, INSERT, UPDATE, DELETE ON whups_guests TO horde;
+GRANT SELECT, INSERT, UPDATE, DELETE ON whups_modules TO horde;
+GRANT SELECT, INSERT, UPDATE, DELETE ON whups_modules_users TO horde;
+GRANT SELECT, INSERT, UPDATE, DELETE ON whups_subjects TO horde;
+GRANT SELECT, INSERT, UPDATE, DELETE ON whups_modules_subjects TO horde;
+GRANT SELECT, INSERT, UPDATE, DELETE ON whups_types TO horde;
+GRANT SELECT, INSERT, UPDATE, DELETE ON whups_types_modules TO horde;
+GRANT SELECT, INSERT, UPDATE, DELETE ON whups_states TO horde;
+GRANT SELECT, INSERT, UPDATE, DELETE ON whups_attributes_desc TO horde;
+GRANT SELECT, INSERT, UPDATE, DELETE ON whups_attributes TO horde;
+GRANT SELECT, INSERT, UPDATE, DELETE ON whups_comments TO horde;
+GRANT SELECT, INSERT, UPDATE, DELETE ON whups_logs TO horde;
+GRANT SELECT, INSERT, UPDATE, DELETE ON whups_priorities TO horde;
+GRANT SELECT, INSERT, UPDATE, DELETE ON whups_versions TO horde;
+GRANT SELECT, INSERT, UPDATE, DELETE ON whups_users_searches TO horde;
+GRANT SELECT, INSERT, UPDATE, DELETE ON whups_users_queries TO horde;
+GRANT SELECT, INSERT, UPDATE, DELETE ON whups_tickets_listeners TO horde;


More information about the whups mailing list