small schema refinements for request_reviews

This commit is contained in:
dandds 2018-09-10 13:33:10 -04:00
parent d3c98523c4
commit aadedfc3b0
6 changed files with 73 additions and 7 deletions

View File

@ -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 ###

View File

@ -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 ###

View File

@ -7,7 +7,7 @@ from .validators import Alphabet, PhoneNumber
class CCPOReviewForm(ValidatedForm): class CCPOReviewForm(ValidatedForm):
comments = TextAreaField("Comments (optional)") comment = TextAreaField("Comments (optional)")
fname_mao = StringField("First Name (optional)", validators=[Alphabet()]) fname_mao = StringField("First Name (optional)", validators=[Alphabet()])
lname_mao = StringField("Last Name (optional)", validators=[Alphabet()]) lname_mao = StringField("Last Name (optional)", validators=[Alphabet()])
email_mao = EmailField("Mission Owner e-mail (optional)", validators=[Email()]) email_mao = EmailField("Mission Owner e-mail (optional)", validators=[Email()])

View File

@ -1,4 +1,4 @@
from sqlalchemy import Column, Integer, String from sqlalchemy import Column, BigInteger, String
from sqlalchemy.orm import relationship from sqlalchemy.orm import relationship
from atst.models import Base from atst.models import Base
@ -7,12 +7,12 @@ from atst.models import Base
class RequestReview(Base): class RequestReview(Base):
__tablename__ = "request_reviews" __tablename__ = "request_reviews"
id = Column(Integer, primary_key=True) id = Column(BigInteger, primary_key=True)
status = relationship("RequestStatusEvent", back_populates="review") status = relationship("RequestStatusEvent", back_populates="review")
comments = Column(String) comment = Column(String)
fname_mao = Column(String) fname_mao = Column(String)
lname_mao = Column(String, nullable=False) lname_mao = Column(String)
email_mao = Column(String) email_mao = Column(String)
phone_mao = Column(String) phone_mao = Column(String)
fname_ccpo = Column(String) fname_ccpo = Column(String)

View File

@ -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. <b>These notes will be visible to the person making the JEDI request</b>. 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. <b>These notes will be visible to the person making the JEDI request</b>.
{{ 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.") }}
</div> </div>

View File

@ -66,7 +66,7 @@ class RequestReviewFactory(Base):
class Meta: class Meta:
model = RequestReview model = RequestReview
comments = factory.Faker("sentence") comment = factory.Faker("sentence")
fname_mao = factory.Faker("first_name") fname_mao = factory.Faker("first_name")
lname_mao = factory.Faker("last_name") lname_mao = factory.Faker("last_name")
email_mao = factory.Faker("email") email_mao = factory.Faker("email")