[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.
--- 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)'