[migration] explicit first step of 3.10.9 migration. oldstable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 24 Mar 2011 13:24:26 +0100
brancholdstable
changeset 7104 62c880e5d980
parent 7097 b4e7099ea2f1
child 7105 aefd1776122f
[migration] explicit first step of 3.10.9 migration. Previously there was on a "commit now" confirmation. The reason of the request are now explained and both request must be confirmed.
misc/migration/3.10.9_Any.py
--- a/misc/migration/3.10.9_Any.py	Mon Mar 21 17:44:57 2011 +0100
+++ b/misc/migration/3.10.9_Any.py	Thu Mar 24 13:24:26 2011 +0100
@@ -1,10 +1,11 @@
 from __future__ import with_statement
 import sys
 
-# fix some corrupted entities noticed on several instances
-rql('DELETE CWConstraint X WHERE NOT E constrained_by X')
-rql('SET X is_instance_of Y WHERE X is Y, NOT X is_instance_of Y')
-commit()
+
+if confirm('fix some corrupted entities noticed on several instances?'):
+    rql('DELETE CWConstraint X WHERE NOT E constrained_by X')
+    rql('SET X is_instance_of Y WHERE X is Y, NOT X is_instance_of Y')
+    commit()
 
 if confirm('fix existing cwuri?'):
     from logilab.common.shellutils import ProgressBar