# HG changeset patch # User Samuel Trégouët # Date 1450170835 -3600 # Node ID 91db22bb8d29eba8ceaefa08fa148bca2d9b2d8f # Parent c8c8f6a6147f56f6179ae1bb36be4c132f8c5466 [dataimport] massive_store: do not drop constraints with `cascade` since it breaks things We want to be able to restore constraints at the end of the import. If they are silently dropped due to a CASCADE, we can't do that. diff -r c8c8f6a6147f -r 91db22bb8d29 dataimport/massive_store.py --- a/dataimport/massive_store.py Mon Dec 21 12:16:12 2015 +0100 +++ b/dataimport/massive_store.py Tue Dec 15 10:13:55 2015 +0100 @@ -332,7 +332,7 @@ for name, query in constraints.items(): sql = 'INSERT INTO cwmassive_constraints VALUES (%(e)s, %(c)s, %(t)s)' self.sql(sql, {'e': tablename, 'c': query, 't': 'constraint'}) - sql = 'ALTER TABLE %s DROP CONSTRAINT %s CASCADE' % (tablename, name) + sql = 'ALTER TABLE %s DROP CONSTRAINT %s' % (tablename, name) self.sql(sql) for name, query in indexes.items(): sql = 'INSERT INTO cwmassive_constraints VALUES (%(e)s, %(c)s, %(t)s)'