Add migration for LOA array type

This commit is contained in:
leigh-mil 2019-02-15 14:42:29 -05:00
parent 8a9fda5370
commit 070ccec23f
2 changed files with 29 additions and 1 deletions

View File

@ -0,0 +1,28 @@
"""Update LOA to Array Type
Revision ID: db161adbafdf
Revises: b3a1a07cf30b
Create Date: 2019-02-15 14:28:33.181136
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'db161adbafdf'
down_revision = 'b3a1a07cf30b'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.execute("ALTER TABLE task_orders ALTER COLUMN loa TYPE varchar[] USING array[loa]")
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.execute("ALTER TABLE task_orders ALTER COLUMN loa TYPE varchar USING loa[1]")
# ### end Alembic commands ###

View File

@ -90,7 +90,7 @@ class TaskOrder(Base, mixins.TimestampsMixin):
pdf_attachment_id = Column(ForeignKey("attachments.id"))
_pdf = relationship("Attachment", foreign_keys=[pdf_attachment_id])
number = Column(String, unique=True) # Task Order Number
loa = Column(String) # Line of Accounting (LOA)
loa = Column(ARRAY(String)) # Line of Accounting (LOA)
custom_clauses = Column(String) # Custom Clauses
signer_dod_id = Column(String)
signed_at = Column(DateTime)