# HG changeset patch # User Sylvain Thénault # Date 1268930015 -3600 # Node ID c3ded02872952ae543bc0f15b38d5f0d1b711c41 # Parent 2654cd5c87e0ae1fa02d849845aaf80e2553323e don't update constraints when it's not necessary diff -r 2654cd5c87e0 -r c3ded0287295 server/migractions.py --- a/server/migractions.py Thu Mar 18 17:33:03 2010 +0100 +++ b/server/migractions.py Thu Mar 18 17:33:35 2010 +0100 @@ -499,15 +499,13 @@ self.rqlexec('DELETE X constrained_by C WHERE C eid %(x)s', {'x': cstr.eid}, 'x', ask_confirm=confirm) - self.rqlexec('DELETE CWConstraint C WHERE C eid %(x)s', - {'x': cstr.eid}, 'x', - ask_confirm=confirm) else: newconstraints.remove(newcstr) - values = {'x': cstr.eid, - 'v': unicode(newcstr.serialize())} - self.rqlexec('SET X value %(v)s WHERE X eid %(x)s', - values, 'x', ask_confirm=confirm) + value = unicode(newcstr.serialize()) + if value != unicode(cstr.serialize()): + self.rqlexec('SET X value %(v)s WHERE X eid %(x)s', + {'x': cstr.eid, 'v': value}, 'x', + ask_confirm=confirm) # 2. add new constraints for newcstr in newconstraints: self.rqlexecall(ss.constraint2rql(rschema, subjtype, objtype,