# HG changeset patch # User Julien Cristau # Date 1455714095 -3600 # Node ID ceb0e8e9129e929028cc50a70cc50688f653cb54 # Parent 20b2e7ceecf6b8e5fe9e9bbe27407134ed000f0c [migration] add rollback when replace_eid_sequence_with_eid_numrange fails If we get here, the current transaction is aborted, so if we are to assume everything is fine and continue we need to rollback first. diff -r 20b2e7ceecf6 -r ceb0e8e9129e cubicweb/misc/migration/bootstrapmigration_repository.py --- a/cubicweb/misc/migration/bootstrapmigration_repository.py Wed Feb 17 14:03:56 2016 +0100 +++ b/cubicweb/misc/migration/bootstrapmigration_repository.py Wed Feb 17 14:01:35 2016 +0100 @@ -45,6 +45,7 @@ cursor.execute(dbh.sql_sequence_current_state('entities_id_seq')) lasteid = cursor.fetchone()[0] except: # programming error, already migrated + session.rollback() return cursor.execute(dbh.sql_drop_sequence('entities_id_seq'))