def rename_abe_sequences_key(store):
 try:
  data = store.selectall('\n            SELECT DISTINCT key, nextid\n              FROM abe_sequences')
 except Exception:
  store.rollback()
  return
 store.log.info('copying sequence positions: %s', data)
 store.ddl('DROP TABLE abe_sequences')
 store.ddl('CREATE TABLE abe_sequences (\n        sequence_key VARCHAR(100) PRIMARY KEY,\n        nextid NUMERIC(30)\n    )')
 for row in data:
  store.sql('INSERT INTO abe_sequences (sequence_key, nextid) VALUES (?, ?)', row)

def rename_abe_sequences_key ( store ) : try : data = store . selectall ( '\n            SELECT DISTINCT key, nextid\n              FROM abe_sequences' ) except Exception : store . rollback ( ) return store . log . info ( 'copying sequence positions: %s' , data ) store . ddl ( 'DROP TABLE abe_sequences' ) store . ddl ( 'CREATE TABLE abe_sequences (\n        sequence_key VARCHAR(100) PRIMARY KEY,\n        nextid NUMERIC(30)\n    )' ) for row in data : store . sql ( 'INSERT INTO abe_sequences (sequence_key, nextid) VALUES (?, ?)' , row )
drop and recreate abe_sequences with key renamed to sequence_key .