Modify

Opened 4 years ago

#7270 new defect

[Patch] ClientsPlugin not working with Postgres 8.4

Reported by: ricardo.ichizo@… Owned by: coling
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 (0)

Add Comment

Modify Ticket

Action
as new .
Author


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

 
Note: See TracTickets for help on using tickets.