[massive store] ensure the cwmassive_initialized table is deleted if needed 3.25
authorDavid Douard <david.douard@logilab.fr>
Wed, 03 May 2017 21:58:48 +0200
branch3.25
changeset 12195 81cf4cf60411
parent 12194 2f9da7a8ecb6
child 12196 b6b87c36beed
[massive store] ensure the cwmassive_initialized table is deleted if needed This may be necessary if a previous import did badly crached, leaving the cwmassive_initialized behind.
cubicweb/dataimport/massive_store.py
--- a/cubicweb/dataimport/massive_store.py	Wed May 03 21:55:41 2017 +0200
+++ b/cubicweb/dataimport/massive_store.py	Wed May 03 21:58:48 2017 +0200
@@ -106,6 +106,7 @@
         """
         assert not self.slave_mode
         if self not in self._initialized:
+            self.sql('DROP TABLE IF EXISTS cwmassive_initialized')
             self.sql('CREATE TABLE cwmassive_initialized'
                      '(retype text, type varchar(128), uuid varchar(32))')
             self._initialized[self] = None