Modify

Opened 14 years ago

Closed 8 years ago

#7270 closed defect (fixed)

[Patch] ClientsPlugin not working with Postgres 8.4

Reported by: ricardo.ichizo@… Owned by: Colin Guthrie
Priority: normal Component: ClientsPlugin
Severity: major Keywords:
Cc: Trac Release: 0.11

Description

The plugin is sending invalid SQL statement to database:

postgresql.log

ERROR:  syntax error at or near "CHANGE" at character 20
STATEMENT:  ALTER TABLE client CHANGE COLUMN default_rate default_rate DECIMAL(10,2)

The correct command must be:

ALTER TABLE client ALTER COLUMN default_rate TYPE DECIMAL(10,2)

The following code resolved this problem:

  • api.py

     
    121121            if self.db_installed_version < 6:
    122122                print 'Updating clients table (v6)'
    123123                cursor.execute('ALTER TABLE client '
    124                                'CHANGE COLUMN default_rate default_rate DECIMAL(10,2)')
     124                               'ALTER COLUMN default_rate TYPE DECIMAL(10,2)')
    125125           
    126126            #if self.db_installed_version < 7:
    127127            #    print 'Updating clients table (v7)'

Attachments (0)

Change History (1)

comment:1 Changed 8 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

Addressed in r9476.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Colin Guthrie.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.