[migration] cleanup corrupted database, pb noticed on several instances stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 03 Mar 2011 15:44:07 +0100
branchstable
changeset 7034 1ac9715876e3
parent 7033 ddc1b4d80dbd
child 7035 8d2cf36bd79d
[migration] cleanup corrupted database, pb noticed on several instances
misc/migration/3.10.9_Any.py
--- a/misc/migration/3.10.9_Any.py	Thu Mar 03 12:55:29 2011 +0100
+++ b/misc/migration/3.10.9_Any.py	Thu Mar 03 15:44:07 2011 +0100
@@ -1,5 +1,10 @@
 from __future__ import with_statement
 
+# 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
     from cubicweb.server.session import hooks_control