# HG changeset patch # User Julien Cristau # Date 1449066052 -3600 # Node ID ec5eeb08f2e8c89847b998a83bc34371c1ead3d8 # Parent ce9b3886955d0caa66548a65f329b4b2afa5cf5a [dataimport] stop supporting None as eids_seq_range It couldn't work as-is because entities_id_seq is not a sequence object. diff -r ce9b3886955d -r ec5eeb08f2e8 dataimport/massive_store.py --- a/dataimport/massive_store.py Wed Dec 02 15:19:24 2015 +0100 +++ b/dataimport/massive_store.py Wed Dec 02 15:20:52 2015 +0100 @@ -384,12 +384,6 @@ if etype not in self._entities: # Only for non-initialized etype and not slave mode store if not self.slave_mode: - if self.eids_seq_range is None: - # Eids are directly set by the entities_id_seq. - # We attach this sequence to all the created etypes. - sql = ("ALTER TABLE cw_%s ALTER COLUMN cw_eid " - "SET DEFAULT nextval('entities_id_seq')" % etype.lower()) - self.sql(sql) # Drop indexes and constraints tablename = 'cw_%s' % etype.lower() self.drop_and_store_indexes(tablename) @@ -438,7 +432,7 @@ if 'cwuri' not in kwargs: kwargs['cwuri'] = self._default_cwuri + str(self._count_cwuri) self._count_cwuri += 1 - if 'eid' not in kwargs and self.eids_seq_range is not None: + if 'eid' not in kwargs: # If eid is not given and the eids sequence is set, # use the value from the sequence kwargs['eid'] = self.get_next_eid() @@ -598,10 +592,6 @@ def _cleanup_entities(self, etype): """ Cleanup etype table """ - if self.eids_seq_range is None: - # Remove DEFAULT eids sequence if added - sql = 'ALTER TABLE cw_%s ALTER COLUMN cw_eid DROP DEFAULT;' % etype.lower() - self.sql(sql) # Create indexes and constraints tablename = SQL_PREFIX + etype.lower() self.reapply_constraint_index(tablename)