Skip to content

Commit

Permalink
added missing unique=True detail to `research_data.questionnaire_re…
Browse files Browse the repository at this point in the history
…ponse_id`
  • Loading branch information
pbugni committed Jun 13, 2024
1 parent bbf4c2a commit 1d6cd4c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion portal/migrations/versions/daee63f50d35_.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def upgrade():
op.f('ix_research_data_patient_id'), 'research_data', ['patient_id'], unique=False)
op.create_index(
op.f('ix_research_data_questionnaire_response_id'),
'research_data', ['questionnaire_response_id'], unique=False)
'research_data', ['questionnaire_response_id'], unique=True)
op.create_index(
op.f('ix_research_data_research_study_id'),
'research_data', ['research_study_id'], unique=False)
Expand Down
2 changes: 1 addition & 1 deletion portal/models/research_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ResearchData(db.Model):
id = db.Column(db.Integer, primary_key=True)
patient_id = db.Column(db.ForeignKey('users.id'), index=True, nullable=False)
questionnaire_response_id = db.Column(
db.ForeignKey('questionnaire_responses.id'), index=True, nullable=False,
db.ForeignKey('questionnaire_responses.id'), index=True, unique=True, nullable=False,
doc="source questionnaire response")
instrument = db.Column(db.Text, index=True, nullable=False)
research_study_id = db.Column(db.Integer, index=True, nullable=False)
Expand Down

0 comments on commit 1d6cd4c

Please sign in to comment.