diff --git a/migrations/versions/42d973f2723f_.py b/migrations/versions/42d973f2723f_.py new file mode 100644 index 0000000..e4a896b --- /dev/null +++ b/migrations/versions/42d973f2723f_.py @@ -0,0 +1,24 @@ +"""Drop HSRNUMBER column from study table + +Revision ID: 42d973f2723f +Revises: c1b37c418abd +Create Date: 2021-08-16 09:37:36.766180 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '42d973f2723f' +down_revision = 'c1b37c418abd' +branch_labels = None +depends_on = None + + +def upgrade(): + op.drop_column('study', 'HSRNUMBER') + + +def downgrade(): + op.add_column('study', sa.Column('HSRNUMBER', sa.String(), nullable=True)) diff --git a/pb/api.yml b/pb/api.yml index d4b3cff..3060320 100644 --- a/pb/api.yml +++ b/pb/api.yml @@ -184,10 +184,6 @@ components: type: number example: 11770 description: The unique id of the study in Protocol Builder. Sometimes referenced as the "HSR Submission number" if you are looking at Protocol Builder - HSRNUMBER: - type: number - example: 15378 - description: This is the number users use to lookup and reference when talking about non SOM protocols in IRB Online and displayed in more documentation. Its only used in IRB Online. Its not an auto increment. TITLE: type: string format: string diff --git a/pb/forms.py b/pb/forms.py index 44a8ba8..479d79f 100644 --- a/pb/forms.py +++ b/pb/forms.py @@ -15,7 +15,6 @@ class StudyForm(FlaskForm): requirements = SelectMultipleField("Documents", render_kw={'class': 'multi'}, choices=[(rd.AUXDOCID, rd.AUXDOC) for rd in RequiredDocument.all()]) - HSRNUMBER = StringField('HSR Number') Q_COMPLETE = SelectField("IRBStatus", choices=[((q.STATUS, q.DETAIL), q.DETAIL) for q in IRBStatus.all()]) diff --git a/pb/models.py b/pb/models.py index 75f39e7..13591ea 100644 --- a/pb/models.py +++ b/pb/models.py @@ -66,7 +66,6 @@ class StudySponsorSchema(ma.Schema): class Study(db.Model): STUDYID = db.Column(db.Integer, primary_key=True) - HSRNUMBER = db.Column(db.String()) TITLE = db.Column(db.Text(), nullable=False) NETBADGEID = db.Column(db.String(), nullable=False) DATE_MODIFIED = db.Column(db.DateTime(timezone=True), default=func.now()) @@ -81,7 +80,7 @@ class Study(db.Model): class StudySchema(ma.Schema): class Meta: # Fields to expose - fields = ("STUDYID", "HSRNUMBER", "TITLE", "NETBADGEID", + fields = ("STUDYID", "TITLE", "NETBADGEID", "DATE_MODIFIED") diff --git a/pb/pb_mock.py b/pb/pb_mock.py index 556af7b..4a90ce3 100644 --- a/pb/pb_mock.py +++ b/pb/pb_mock.py @@ -85,7 +85,6 @@ def _update_study(study, form): study.TITLE = form.TITLE.data study.NETBADGEID = form.NETBADGEID.data study.DATE_MODIFIED = datetime.datetime.now() - study.HSRNUMBER = form.HSRNUMBER.data for r in form.requirements: if r.checked: