hooks/syncschema.py
branchstable
changeset 9559 072429be2d95
parent 8943 58b3b2d9c965
child 9565 fa00fc251d57
equal deleted inserted replaced
9540:43b4895a150f 9559:072429be2d95
   674     def precommit_event(self):
   674     def precommit_event(self):
   675         session = self.session
   675         session = self.session
   676         rdef = self.rdef
   676         rdef = self.rdef
   677         # in-place modification of in-memory schema first
   677         # in-place modification of in-memory schema first
   678         _set_modifiable_constraints(rdef)
   678         _set_modifiable_constraints(rdef)
   679         rdef.constraints.remove(self.oldcstr)
   679         if self.oldcstr in rdef.constraints:
       
   680             rdef.constraints.remove(self.oldcstr)
       
   681         else:
       
   682             self.critical('constraint %s for rdef %s was missing or already removed',
       
   683                           self.oldcstr, rdef)
   680         # then update database: alter the physical schema on size/unique
   684         # then update database: alter the physical schema on size/unique
   681         # constraint changes
   685         # constraint changes
   682         syssource = session.cnxset.source('system')
   686         syssource = session.cnxset.source('system')
   683         cstrtype = self.oldcstr.type()
   687         cstrtype = self.oldcstr.type()
   684         if cstrtype == 'SizeConstraint':
   688         if cstrtype == 'SizeConstraint':