Add migration for LOA array type
This commit is contained in:
parent
8a9fda5370
commit
070ccec23f
28
alembic/versions/db161adbafdf_update_loa_to_array_type.py
Normal file
28
alembic/versions/db161adbafdf_update_loa_to_array_type.py
Normal 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 ###
|
@ -90,7 +90,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, 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
|
custom_clauses = Column(String) # Custom Clauses
|
||||||
signer_dod_id = Column(String)
|
signer_dod_id = Column(String)
|
||||||
signed_at = Column(DateTime)
|
signed_at = Column(DateTime)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user