Merge pull request #948 from dod-ccpo/non-unique-to

Do not enforce TO number uniqueness.
This commit is contained in:
dandds 2019-06-19 13:19:21 -04:00 committed by GitHub
commit f46d1f80af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 1 deletions

View File

@ -0,0 +1,25 @@
"""remove task_orders.number unique constraint
Revision ID: d966d7194f5c
Revises: 3d3c71b03e98
Create Date: 2019-06-19 12:53:39.502250
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd966d7194f5c'
down_revision = '3d3c71b03e98'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint('task_orders_number_key1', 'task_orders', type_='unique')
# ### end Alembic commands ###
# Not downgradeable; would have to determine what redundant TOs to delete

View File

@ -40,7 +40,7 @@ class TaskOrder(Base, mixins.TimestampsMixin):
pdf_attachment_id = Column(ForeignKey("attachments.id")) pdf_attachment_id = Column(ForeignKey("attachments.id"))
_pdf = relationship("Attachment", foreign_keys=[pdf_attachment_id]) _pdf = relationship("Attachment", foreign_keys=[pdf_attachment_id])
number = Column(String, unique=True) # Task Order Number number = Column(String) # Task Order Number
signer_dod_id = Column(String) signer_dod_id = Column(String)
signed_at = Column(DateTime) signed_at = Column(DateTime)