[hooks/syncschema] avoid altering a dropped table
authorJulien Cristau <julien.cristau@logilab.fr>
Wed, 16 Jul 2014 17:20:55 +0200
changeset 9888 5b48dcc02be1
parent 9887 152c09c2f0ed
child 9889 9b42e55e0686
[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
hooks/syncschema.py
--- 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