Skip to content

Commit

Permalink
add index harvest_error_harvest_object_id_idx
Browse files Browse the repository at this point in the history
  • Loading branch information
FuhuXia committed Oct 10, 2022
1 parent cb0a703 commit 41a620b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ckanext/harvest/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ def setup():
log.debug('Creating index for harvest_object_extra')
Index("harvest_object_id_idx", harvest_object_extra_table.c.harvest_object_id).create()

index_names = [index['name'] for index in inspector.get_indexes("harvest_object_error")]
if "harvest_error_harvest_object_id_idx" not in index_names:
log.debug('Creating index for harvest_object_error')
Index("harvest_error_harvest_object_id_idx", harvest_object_error_table.c.harvest_object_id).create()


class HarvestError(Exception):
pass
Expand Down Expand Up @@ -398,6 +403,7 @@ def define_harvester_tables():
Column('stage', types.UnicodeText),
Column('line', types.Integer),
Column('created', types.DateTime, default=datetime.datetime.utcnow),
Index('harvest_error_harvest_object_id_idx', 'harvest_object_id'),
)
# Harvest Log table
harvest_log_table = Table(
Expand Down

0 comments on commit 41a620b

Please sign in to comment.