[migration/3.18] Only commit when we did something
authorDenis Laxalde <denis.laxalde@logilab.fr>
Tue, 14 Jan 2014 14:02:51 +0100
changeset 9406 38debfa8b536
parent 9401 17dc43c1f1bd
child 9407 34fccd9104bc
[migration/3.18] Only commit when we did something Avoids countless confirmation prompts. Closes #3438804.
misc/migration/3.18.0_Any.py
--- a/misc/migration/3.18.0_Any.py	Fri Jan 10 18:31:07 2014 +0100
+++ b/misc/migration/3.18.0_Any.py	Tue Jan 14 14:02:51 2014 +0100
@@ -80,7 +80,7 @@
             sql('DELETE FROM %s_relation WHERE eid_from IN (%s) OR eid_to IN (%s)' % (rschema.type, martians, martians))
         with session.deny_all_hooks_but():
             rql('SET X %(r)s Y WHERE Y %(r)s X, NOT X %(r)s Y' % {'r': rschema.type})
-    commit()
+        commit()
 
 
 # multi columns unique constraints regeneration