Modify

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#2077 closed defect (wontfix)

Trac environment upgrade fails using MySQL

Reported by: jluna Owned by: coderanger
Priority: high Component: TracForgePlugin
Severity: major Keywords: mysql schema upgrade database
Cc: Trac Release: 0.10

Description

When [re-]creating the TracForge tables, MySQL drops out with:

Incorrect table definition; there can be only one auto column and it must be defined as a key

Anyhow, it's an easy fix. The annoying part is that it leaves the database in a half-updated state. Perhaps upgrade_environment should be wrapped in a generic try-except block to perform a database rollback in the event of an error?

Attachments (0)

Change History (5)

comment:1 in reply to: ↑ description ; follow-up: Changed 7 years ago by Paul.Thomson@…

Replying to jluna:

When [re-]creating the TracForge tables, MySQL drops out with:

Incorrect table definition; there can be only one auto column and it must be defined as a key

Anyhow, it's an easy fix. The annoying part is that it leaves the database in a half-updated state. Perhaps upgrade_environment should be wrapped in a generic try-except block to perform a database rollback in the event of an error?

comment:2 in reply to: ↑ 1 Changed 7 years ago by anonymous

I am having the same problem - could you please let me know your fix?

Many thanks,

Paul

comment:3 Changed 7 years ago by coderanger

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

I do not test on MySQL, nor do I plan to, so consider this even more unsupported than normal.

comment:4 Changed 7 years ago by anonymous

Yeah, thanks for that. Big help for those of us who choose to use MySQL for various legitimate reasons.

comment:5 Changed 7 years ago by anonymous

FIX IS SIMPLE:

--- tracforge/admin/db_default.py.orig  2007-12-27 12:00:17.000000000 -0800
+++ tracforge/admin/db_default.py       2007-12-27 12:00:26.000000000 -0800
@@ -7,7 +7,7 @@
         Column('name'),
         Column('env_path'),
     ],
-    Table('tracforge_project_log', key=('project', 'action'))[
+    Table('tracforge_project_log', key=('project', 'action', 'id'))[
         Column('id', auto_increment=True),
         Column('project'),
         Column('action'),

Add Comment

Modify Ticket

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