Modify

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#846 closed defect (fixed)

Postgres not working

Reported by: anonymous Owned by: sambloomquist
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 7 years ago by sambloomquist

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 7 years ago by coderanger

This may be of some help.

comment:3 Changed 7 years ago by sambloomquist

  • Resolution set to fixed
  • Status changed from new to closed

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

fixes #846

comment:4 Changed 7 years ago by sambloomquist

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 7 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 7 years ago by sambloomquist

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 follow-up: Changed 7 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 7 years ago by sambloomquist

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.

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from sambloomquist. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.