Modify

Opened 8 years ago

Closed 8 years ago

#470 closed defect (fixed)

Database upgrade fails on PostgreSQL

Reported by: hrvelic@… Owned by: Blackhex
Priority: normal Component: DiscussionPlugin
Severity: blocker Keywords:
Cc: Trac Release: 0.9

Description (last modified by coderanger)

Hello. I have done the following:

  1. Downloaded and unzipped the plugin from it's homepage on trac-hacks file name is discussionplugin-r967.zip
  2. I have built the egg using python setup.py bdist_egg and installed it with easy_install --always-unzip options.
  3. I have added the following lines to the global trac.ini:
    [components]
    tracdiscussion.* = enabled
    
    [discussion]
    title = Discussion
    
  4. I have tried upgrading the environment with:

trac-admin /path/to/env upgrade --no-backup Unfortunately, it ended up with an error:

Command failed: ERROR:  column "discussion_version" does not exist

INSERT INTO system VALUES ("discussion_version", 1);

I'm using the following:

  • Ubuntu 6.06 Dapper Drake
  • Apache 2.0.xx
  • mod_python
  • Python 2.4
  • Trac 0.9.5
  • PostgreSQL 8.1

Thanks, Hrvoje Velic

Attachments (0)

Change History (7)

comment:1 Changed 8 years ago by hrvelic@…

Sorry for the mess in original post. Forgot to use Wiki Formatting...
A much better formatted version follows:
1) Downloaded and unzipped the plugin from it's homepage on trac-hacks file name is: discussionplugin-r967.zip
2) I have built the egg using python setup.py bdist_egg and installed it with easy_install —always-unzip options.
3) I have added the following lines to the global trac.ini:

[components]
tracdiscussion.* = enabled

[discussion]
title = Discussion

4) I have tried upgrading the environment with:

trac-admin /path/to/env upgrade —no-backup

Unfortunately, it ended up with an error:

Command failed: ERROR: column "discussion_version" does not exist

INSERT INTO system VALUES ("discussion_version", 1);

I'm using the following:

  • Ubuntu 6.06 Dapper Drake
  • Apache 2.0.xx
  • mod_python
  • Python 2.4
  • Trac 0.9.5
  • PostgreSQL 8.1

Thanks,
Hrvoje Velic

comment:2 Changed 8 years ago by kauberry

First of all, thanks for your work on this. This plugin looks like a good value add for Trac.

However, I'm also having the same type of issues with an upgrade error using PostgreSQL with the following setup

  • Redhat Enterprise Linux AW4
  • Apache 2.2.x
  • mod_python
  • Python 2.4
  • Trac 0.10 dev (r3345)
  • PostgreSQL 8.1

Just another data point.

Thanks, Ken Auberry

comment:3 Changed 8 years ago by coderanger

  • Description modified (diff)

Fix formatting in the description

comment:4 Changed 8 years ago by Blackhex

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

Changeset 976 should fix problem with incomplete INSERT statement. If it doesn't please reopen with apropriate log outputs.

comment:5 Changed 8 years ago by kauberry

  • Resolution fixed deleted
  • Status changed from closed to reopened

After examining the code and tinkering in the database schema locally, I found that changing the double quotes (") around the INSERT statement in tracdiscussion/db/db1.py to single quotes (') would allow the upgrade to proceed unhindered. See below.

INSERT INTO system (name, value) VALUES ('discussion_version', 1)

instead of

INSERT INTO system (name, value) VALUES ("discussion_version", 1)

similarly for the UPDATE statement in db2.py...

UPDATE system SET value = 2 WHERE name='discussion_version'
{{{
instead of
UPDATE system SET value = "2" WHERE name="discussion_version"
}}}

Hope this helps,
Ken Auberry

comment:6 Changed 8 years ago by Blackhex

I've changed all sql statement in changeset 981. I haven't PostgreSQL installed so it is not tested yet. Please let me know if it works, thank you.

comment:7 Changed 8 years ago by hrvelic@…

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

Upgrading DB now works.
And I've already modified all the statements by hand. It was the problem of double quotes instead of single quotes. I've checkedout the latest version from subversion too and replaced my modified one. Unfortunately, I get errors when trying to create a forum. I'll post another ticket for that with the details. Thank you for your time and effort. :)

Add Comment

Modify Ticket

Action
as closed The owner will remain Blackhex.
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.