[hooks/syncschema] avoid altering a dropped table
If the constraint's rdef is being removed, CWConstraintDelOp doesn't
need to do anything. Otherwise it may try to alter a removed
table/column. Closes #4154549
--- a/hooks/syncschema.py Thu Jun 12 09:59:55 2014 +0200
+++ b/hooks/syncschema.py Wed Jul 16 17:20:55 2014 +0200
@@ -653,6 +653,9 @@
else:
self.critical('constraint %s for rdef %s was missing or already removed',
self.oldcstr, rdef)
+ if cnx.deleted_in_transaction(rdef.eid):
+ # don't try to alter a table that's going away (or is already gone)
+ return
# then update database: alter the physical schema on size/unique
# constraint changes
syssource = cnx.repo.system_source