- Timestamp:
- Mar 28, 2015, 8:28:32 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20150112/ippToPsps/jython/mysql.py
r37246 r38052 258 258 self.execute(sql) 259 259 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 + "'") 261 262 ''' 262 263 Changes the database engine for this table to InnoDb … … 477 478 self.execute("SET @i = 0") 478 479 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.
