Skip to content

Commit

Permalink
add unique constraint for record table
Browse files Browse the repository at this point in the history
  • Loading branch information
Jin-Sun-tts committed Mar 20, 2024
1 parent 290d066 commit eedec56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from sqlalchemy.dialects.postgresql import UUID, ARRAY
from sqlalchemy.sql import text
from sqlalchemy import Enum
from sqlalchemy.schema import Index
from sqlalchemy.schema import UniqueConstraint

db = SQLAlchemy()

Expand Down Expand Up @@ -78,5 +78,5 @@ class HarvestRecord(Base):
type = db.Column(db.String(), nullable=False)
source_metadata = db.Column(db.String(), nullable=True)
__table_args__ = (
Index('ix_job_id_identifier', 'job_id', 'identifier'),
UniqueConstraint('job_id', 'identifier', name='uix_job_id_identifier'),
)

1 comment on commit eedec56

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
harvester
   __init__.py50100% 
   ckan_utils.py4222 95%
   exceptions.py420100% 
   harvest.py4256565 85%
   logger_config.py10100% 
   utils.py3522 94%
TOTAL5506987% 

Tests Skipped Failures Errors Time
28 0 💤 0 ❌ 0 🔥 2.205s ⏱️

Please sign in to comment.