Modify

Opened 4 years ago

Closed 4 years ago

#7925 closed defect (fixed)

trac-admin upgrade fails on postgresql/sqlite

Reported by: anonymous Owned by: coling
Priority: normal Component: ClientsPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

Failing line is:

ERROR: WorklogPlugin Exception: ERROR: syntax error at or near "CHANGE"
LINE 1: ALTER TABLE client CHANGE COLUMN default_rate default_rate DECIMAL(10,2)

In api.py I did a quick fix, commented out the V6 update, and changed from integer to decimal(10,2)

cursor.execute('CREATE TABLE client ('

'name TEXT,'
'description TEXT,'
'default_rate DECIMAL(10,2),'
'currency TEXT'
')')

cursor.execute('INSERT INTO client SELECT name, description, default_rate, currency FROM client_tmp')
cursor.execute('DROP TABLE client_tmp')

#if self.db_installed_version < 6:
# print 'Updating clients table (v6)'
# cursor.execute('ALTER TABLE client '
# 'CHANGE COLUMN default_rate default_rate DECIMAL(10,2)')

Attachments (0)

Change History (3)

comment:1 Changed 4 years ago by coling

  • Summary changed from trac-admin upgrade fails on postgresql to trac-admin upgrade fails on postgresql/sqlite

Also affects Sqlite. Fix coming shortly.

comment:2 Changed 4 years ago by coling

(In [9476]) Apparently SQLite and Postgres don't support much in the way of CHANGE COLUMN statements :(

Here is an ugly workaround for that limitation.
Refs #7925

comment:3 Changed 4 years ago by coling

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

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 coling. 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.