Modify

Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#846 closed defect (fixed)

Postgres not working

Reported by: anonymous Owned by: Sam Bloomquist
Priority: normal Component: ScrumBurndownPlugin
Severity: critical Keywords:
Cc: nick.stone@… Trac Release: 0.9

Description

The plug in doesn't work with postgres. The first error is at line 42 as this is clearly written for sqlite. The line is:

cursor.execute("SELECT name FROM sqlite_master WHERE type='table' AND name='burndown'")

Can you look into fixing that as we'd love to use the plugin otherwise

Attachments (0)

Change History (8)

comment:1 Changed 18 years ago by Sam Bloomquist

Ah, yes. I forgot about postgres. The only problem is that I only learned enough about the inner workings of Trac to get this plugin up and working for my own team. If someone else could point me toward the proper (database-independent) way to do this in Trac, I'd be happy to make the change.

comment:2 Changed 18 years ago by Noah Kantrowitz

This may be of some help.

comment:3 Changed 18 years ago by Sam Bloomquist

Resolution: fixed
Status: newclosed

(In [1495]) Got rid of sqlite-specific call in BurndownComponent.environment_needs_upgrade().

fixes #846

comment:4 Changed 18 years ago by Sam Bloomquist

Thanks for the tip, coderanger. That was easy enough. Sorry it took me so long to get to this. I haven't tested this with postgres, but it didn't break anything for sqlite. Please re-open this ticket if the fix didn't work.

For those who care, here is what the new code looks like:

        # See if the burndown table exists, if not, return True because we need to upgrade the database
        cursor = db.cursor()
        try:
            cursor.execute('SELECT * FROM %s LIMIT 1', 'burndown')
        except:
            needsUpgrade = True

comment:5 Changed 18 years ago by nickstone

Thanks for the fix - I'll have a play and let you know if there's any problems

comment:6 Changed 18 years ago by Sam Bloomquist

Note the fix for this ticket has been included in the following egg version (which is now available on from the ScrumBurndownPlugin wiki page:

TracBurndown-01.03.10-py2.3.egg

comment:7 Changed 18 years ago by anonymous

Is this what you meant:

cursor.execute('SELECT * FROM %s LIMIT 1' % 'burndown')

(Note '%' instead of comma ',' near burndown)

Chris

comment:8 in reply to:  7 Changed 18 years ago by Sam Bloomquist

Replying to anonymous:

Is this what you meant:

cursor.execute('SELECT * FROM %s LIMIT 1' % 'burndown')

(Note '%' instead of comma ',' near burndown)

Chris

Either syntax should work. I went with the comma for consistency's sake.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Sam Bloomquist.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.