Modify

Opened 8 years ago

Closed 8 years ago

#525 closed defect (invalid)

Failed to upgrade environment after installing

Reported by: j.huppertz@… Owned by: Blackhex
Priority: normal Component: DiscussionPlugin
Severity: major Keywords:
Cc: Trac Release: 0.9

Description

hi there!

I followed all of the installation steps,
but when I tried to upgrade my environment, it says:

Command failed: near "ALTER": syntax error

I am using trac 0.9.6 and the latest discussionplugin

thanks for any help!

regards,
Julian Huppertz

Attachments (0)

Change History (11)

comment:1 Changed 8 years ago by Blackhex

  • Status changed from new to assigned

What is your sqlite version please?

comment:2 Changed 8 years ago by j.huppertz@…

it's 2.8.17

comment:3 Changed 8 years ago by Blackhex

So here is the problem. I think that Track version 0.9 should run on sqlite version 3.x. Anyway old version of sqlite doesn't have ALTER TABLE ... RENAME TO ... statement support. Please upgrade to version 3.x.

comment:4 Changed 8 years ago by Blackhex

Sorry, ALTER TABLE ... ADD COLUMN statement.

comment:5 Changed 8 years ago by j.huppertz@…

okay, I hope I can figure it out how to do that.. Thanks for the quick answer!

comment:6 Changed 8 years ago by Blackhex

  • Resolution set to invalid
  • Status changed from assigned to closed

So this is invalid.

comment:7 Changed 8 years ago by marcellglx

  • Priority changed from high to normal
  • Resolution invalid deleted
  • Status changed from closed to reopened

sqlite-3.1.2-3
sqlite-devel-3.1.2-3
python-sqlite-1.1.6-1
trac-0.9.5

trac-admin /var/trac/projects/test/ upgrade
Command failed: near "ADD": syntax error

comment:8 follow-up: Changed 8 years ago by Blackhex

I'm only guessing but your pysqlite version is too late than mine (2.3.1). I'm not sure if upgrade help but you could try it to investigate where is problem. You can try if your sqlite installation support ALTER TABLE <table> ADD COLUMNT <name> <type>; statement in command line tool and check if forum table exists.

comment:9 in reply to: ↑ 8 Changed 8 years ago by marcellglx

Replying to Blackhex:

I'm only guessing but your pysqlite version is too late than mine (2.3.1). I'm not sure if upgrade help but you could try it to investigate where is problem. You can try if your sqlite installation support ALTER TABLE <table> ADD COLUMNT <name> <type>; statement in command line tool and check if forum table exists.


I have Linux Fedora Core 4, so I try to install 'pysqlite2'
yum install python-sqlite2

So now I have these versions:
python-2.4.1-2
mod_python-3.1.4-2
python-sqlite-1.1.6-1
python-sqlite2-2.0.7-1.fc4
sqlite-3.1.2-3

I can't remove pysqlite 1.1.6-1 because:
error: Failed dependencies:

python-sqlite is needed by (installed) yum-2.3.2-7.noarch


Although I have python-sqlite2, upgrade of Trac project failed.


First trac-admin command:
trac-admin /var/trac/projects/test/ upgrade
Command failed: near "ADD": syntax error

Every next trac-admin command:
trac-admin /var/trac/projects/test/ upgrade
Command failed: table forum_group already exists


sqlite3:
sqlite> create table test (name integer);
sqlite> alter table test add columnt value integer;
SQL error: near "add": syntax error


What should I do ?

comment:10 follow-up: Changed 8 years ago by Blackhex

At first try again ALTER TABLE test ADD COLUMNT value integer; but instead of COLUMNT type COLUMN :-). If it will succseed then problem is probably with pysqlite version and then you have to create tables manually (I'll tell you how if needed). If it won't succeed then problem is with sqlite itself. I don't know what version exactly comes with ALTER TABLE statement but it should be version 3. I'm using 3.3.6. There is no table existance cheking so when you fail with upgrade you have to drop any created tables (forum_group, forum, topic, message).

comment:11 in reply to: ↑ 10 Changed 8 years ago by marcellglx

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

Replying to Blackhex:

At first try again ALTER TABLE test ADD COLUMNT value integer; but instead of COLUMNT type COLUMN :-). If it will succseed then problem is probably with pysqlite version and then you have to create tables manually (I'll tell you how if needed). If it won't succeed then problem is with sqlite itself. I don't know what version exactly comes with ALTER TABLE statement but it should be version 3. I'm using 3.3.6. There is no table existance cheking so when you fail with upgrade you have to drop any created tables (forum_group, forum, topic, message).

OK. I have download and install http://www.sqlite.org/download.html sqlite-3.3.6.tar.gz
./configure --prefix=/usr
make && make install

/usr/bin/sqlite3 -version
3.3.6

than I make delete.discuss.sql:
delete from system where name="discussion_version";
drop table forum;
drop table forum_group;
drop table topic;
drop table message;

and run:
sqlite3 /var/trac/projects/test/db/trac.db
.read delete.discuss.sql


Than command:
trac-admin /var/trac/projects/test/ upgrade
exit with no error, AND I HAVE MY DISCUSSION !!! :-)


Thanks for help !!!

Add Comment

Modify Ticket

Action
as 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.