On Wednesday 04 August 2010, Christopher wrote:
> That helped, thank you.
> The Table is named agilo_backlog_ticket - after deleting this
> constraint in all our projects we can use our agilo pro now.

True, my bad. I copied the line from the upgrade script where it renames 
the table to _old beforehand.

> Maybe the next update comes without any complication for us.

I am not sure what caused this. We have acceptance tests covering the 
upgrade scripts with different database types and environments, and 
revisiting the code I cannot imagine why this broke for you. If you know 
some Python, here it is:

table_name = {'name': 'agilo_backlog_ticket'}
self.cursor.execute('ALTER TABLE %(name)s RENAME TO 
                     %(name)s_old' % table_name)
self.drop_postgres_primary_key()
create_table_with_cursor(self.new_table(), self.cursor, 
                         self.db_connector)
...
   
def drop_postgres_primary_key(self):
    if get_db_type(self.env) != 'postgres':
        return
    if not self.has_postgres_primary_key('agilo_backlog_ticket_pk'):
        return
    self.cursor.execute('ALTER TABLE agilo_backlog_ticket_old DROP 
            CONSTRAINT agilo_backlog_ticket_pk')
    
def has_postgres_primary_key(self, constraint_name):
    self.cursor.execute("SELECT constraint_name "
                        "FROM information_schema.table_constraints "
                        "WHERE constraint_name='%s'" % constraint_name)
    return 1 == len(self.cursor.fetchall())


Cheers
Robert

-- 
Follow Agilo on Twitter: http://twitter.com/agiloforscrum
Please support us by reviewing and voting on: 
http://userstories.com/products/8-agilo-for-scrum 
http://ohloh.net/p/agilo-scrum 
http://freshmeat.net/projects/agiloforscrum

You have received this message because you are subscribed to
the "Agilo for Scrum" Google Group. This group is focused on
supporting Agilo for Scrum users and is moderated by
agile42 GmbH <http://www.agile42.com>.

To post to this group, send email to [email protected]
To unsubscribe from this group, send an email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/agilo

Reply via email to