diff --git a/alembic/versions/53ab3edd334b_request_reviews_comment_column_name.py b/alembic/versions/53ab3edd334b_request_reviews_comment_column_name.py new file mode 100644 index 00000000..35b52d1d --- /dev/null +++ b/alembic/versions/53ab3edd334b_request_reviews_comment_column_name.py @@ -0,0 +1,30 @@ +"""request_reviews comment column name + +Revision ID: 53ab3edd334b +Revises: 777ded5c57a0 +Create Date: 2018-09-10 13:29:02.648359 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '53ab3edd334b' +down_revision = '777ded5c57a0' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('request_reviews', sa.Column('comment', sa.String(), nullable=True)) + op.drop_column('request_reviews', 'comments') + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('request_reviews', sa.Column('comments', sa.VARCHAR(), autoincrement=False, nullable=True)) + op.drop_column('request_reviews', 'comment') + # ### end Alembic commands ### diff --git a/alembic/versions/777ded5c57a0_bigint_for_request_review_id.py b/alembic/versions/777ded5c57a0_bigint_for_request_review_id.py new file mode 100644 index 00000000..c76ca8e4 --- /dev/null +++ b/alembic/versions/777ded5c57a0_bigint_for_request_review_id.py @@ -0,0 +1,36 @@ +"""bigint for request review id + +Revision ID: 777ded5c57a0 +Revises: 7bdb2055d7c7 +Create Date: 2018-09-10 13:24:36.328610 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '777ded5c57a0' +down_revision = '7bdb2055d7c7' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.alter_column('request_reviews', 'id', + existing_type=sa.Integer(), + type_=sa.BigInteger(), + nullable=False) + pass + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.alter_column('request_reviews', 'id', + existing_type=sa.BigInteger(), + type_=sa.Integer(), + nullable=False) + pass + # ### end Alembic commands ### diff --git a/atst/forms/ccpo_review.py b/atst/forms/ccpo_review.py index ba3116d0..1742ca6d 100644 --- a/atst/forms/ccpo_review.py +++ b/atst/forms/ccpo_review.py @@ -7,7 +7,7 @@ from .validators import Alphabet, PhoneNumber class CCPOReviewForm(ValidatedForm): - comments = TextAreaField("Comments (optional)") + comment = TextAreaField("Comments (optional)") fname_mao = StringField("First Name (optional)", validators=[Alphabet()]) lname_mao = StringField("Last Name (optional)", validators=[Alphabet()]) email_mao = EmailField("Mission Owner e-mail (optional)", validators=[Email()]) diff --git a/atst/models/request_review.py b/atst/models/request_review.py index ac0ba88f..58a6b121 100644 --- a/atst/models/request_review.py +++ b/atst/models/request_review.py @@ -1,4 +1,4 @@ -from sqlalchemy import Column, Integer, String +from sqlalchemy import Column, BigInteger, String from sqlalchemy.orm import relationship from atst.models import Base @@ -7,12 +7,12 @@ from atst.models import Base class RequestReview(Base): __tablename__ = "request_reviews" - id = Column(Integer, primary_key=True) + id = Column(BigInteger, primary_key=True) status = relationship("RequestStatusEvent", back_populates="review") - comments = Column(String) + comment = Column(String) fname_mao = Column(String) - lname_mao = Column(String, nullable=False) + lname_mao = Column(String) email_mao = Column(String) phone_mao = Column(String) fname_ccpo = Column(String) diff --git a/templates/requests/approval.html b/templates/requests/approval.html index cb9df6fc..deaf8504 100644 --- a/templates/requests/approval.html +++ b/templates/requests/approval.html @@ -40,7 +40,7 @@ Provide instructions or notes for additional information that is necessary to approve the request here. The requestor may then re-submit the updated request or initiate contact outside of AT-AT if further discussion is required. These notes will be visible to the person making the JEDI request. - {{ TextInput(f.comments, paragraph=True, placeholder="Add notes or comments explaining what changes are being requested or why further discussion is needed about this request.") }} + {{ TextInput(f.comment, paragraph=True, placeholder="Add notes or comments explaining what changes are being requested or why further discussion is needed about this request.") }} diff --git a/tests/factories.py b/tests/factories.py index 58c2861c..ad8cb048 100644 --- a/tests/factories.py +++ b/tests/factories.py @@ -66,7 +66,7 @@ class RequestReviewFactory(Base): class Meta: model = RequestReview - comments = factory.Faker("sentence") + comment = factory.Faker("sentence") fname_mao = factory.Faker("first_name") lname_mao = factory.Faker("last_name") email_mao = factory.Faker("email")