IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 20, 2015, 1:19:35 PM (11 years ago)
Author:
heather
Message:

current state of ipptopsps / sas37 - ob/p2/st/df work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/mysql.py

    r37246 r37917  
    258258            self.execute(sql)
    259259        except: pass
    260             #self.logger.warn("Index already in place on '" + column + "' for table '" + table + "'")
     260           
     261           # self.logger.warn("Index already in place on '" + column + "' for table '" + table + "'")
    261262    '''
    262263    Changes the database engine for this table to InnoDb
     
    477478        self.execute("SET @i = 0")
    478479        self.execute("UPDATE " + table + " SET " + colName + "=(@i:=@i+1)")
    479         self.execute("ALTER TABLE " + table + " ADD PRIMARY KEY (" + colName + ")")
    480 
     480        self.execute("ALTER IGNORE TABLE " + table + " ADD PRIMARY KEY (" + colName + ")")
     481
     482    '''                                                                                                                                             
     483    Adds a column to this table which contains a row count                                                                                         
     484    '''
     485    def addRowCountColumnNoKey(self, table, colName):
     486
     487        self.execute("ALTER TABLE " + table + " ADD COLUMN " + colName + " INTEGER FIRST")
     488        self.execute("SET @i = 0")
     489        self.execute("UPDATE " + table + " SET " + colName + "=(@i:=@i+1)")
     490
Note: See TracChangeset for help on using the changeset viewer.