Changeset 37917 for trunk/ippToPsps/jython/mysql.py
- Timestamp:
- Feb 20, 2015, 1:19:35 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/mysql.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/mysql.py
r37246 r37917 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.
