def delete_column_constraints(func):
 def _column_rm(self, table_name, column_name, *args, **opts):
  try:
   self.delete_foreign_key(table_name, column_name)
  except ValueError:
   pass
  try:
   reverse = self._lookup_reverse_constraint(table_name, column_name)
   for (cname, rtable, rcolumn) in reverse:
    self.delete_foreign_key(rtable, rcolumn)
  except DryRunError:
   pass
  return func(self, table_name, column_name, *args, **opts)
 return _column_rm

def delete_column_constraints ( func ) : def _column_rm ( self , table_name , column_name , * args , ** opts ) : try : self . delete_foreign_key ( table_name , column_name ) except ValueError : pass try : reverse = self . _lookup_reverse_constraint ( table_name , column_name ) for ( cname , rtable , rcolumn ) in reverse : self . delete_foreign_key ( rtable , rcolumn ) except DryRunError : pass return func ( self , table_name , column_name , * args , ** opts ) return _column_rm
decorates column operation functions for mysql .