hooks/syncschema.py
branchstable
changeset 9559 072429be2d95
parent 8943 58b3b2d9c965
child 9565 fa00fc251d57
--- a/hooks/syncschema.py	Fri Feb 14 17:52:49 2014 +0100
+++ b/hooks/syncschema.py	Thu Feb 27 18:10:29 2014 +0100
@@ -676,7 +676,11 @@
         rdef = self.rdef
         # in-place modification of in-memory schema first
         _set_modifiable_constraints(rdef)
-        rdef.constraints.remove(self.oldcstr)
+        if self.oldcstr in rdef.constraints:
+            rdef.constraints.remove(self.oldcstr)
+        else:
+            self.critical('constraint %s for rdef %s was missing or already removed',
+                          self.oldcstr, rdef)
         # then update database: alter the physical schema on size/unique
         # constraint changes
         syssource = session.cnxset.source('system')