hooks/syncschema.py
changeset 9897 fa44db7da2dc
parent 9888 5b48dcc02be1
child 9949 e0f1c5697221
child 10035 c5bcdece77fb
equal deleted inserted replaced
9892:928732ec00dd 9897:fa44db7da2dc
   651         if self.oldcstr in rdef.constraints:
   651         if self.oldcstr in rdef.constraints:
   652             rdef.constraints.remove(self.oldcstr)
   652             rdef.constraints.remove(self.oldcstr)
   653         else:
   653         else:
   654             self.critical('constraint %s for rdef %s was missing or already removed',
   654             self.critical('constraint %s for rdef %s was missing or already removed',
   655                           self.oldcstr, rdef)
   655                           self.oldcstr, rdef)
       
   656         if cnx.deleted_in_transaction(rdef.eid):
       
   657             # don't try to alter a table that's going away (or is already gone)
       
   658             return
   656         # then update database: alter the physical schema on size/unique
   659         # then update database: alter the physical schema on size/unique
   657         # constraint changes
   660         # constraint changes
   658         syssource = cnx.repo.system_source
   661         syssource = cnx.repo.system_source
   659         cstrtype = self.oldcstr.type()
   662         cstrtype = self.oldcstr.type()
   660         if cstrtype == 'SizeConstraint':
   663         if cstrtype == 'SizeConstraint':