add new task order fields
This commit is contained in:
parent
6c67166e86
commit
f2dbed1ef1
@ -0,0 +1,44 @@
|
||||
"""add additional task order fields
|
||||
|
||||
Revision ID: 875e4b8a05fc
|
||||
Revises: 05d6272bdb43
|
||||
Create Date: 2018-08-21 15:52:46.636928
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '875e4b8a05fc'
|
||||
down_revision = '05d6272bdb43'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('task_order', sa.Column('clin_0001', sa.Integer(), nullable=True))
|
||||
op.add_column('task_order', sa.Column('clin_0003', sa.Integer(), nullable=True))
|
||||
op.add_column('task_order', sa.Column('clin_1001', sa.Integer(), nullable=True))
|
||||
op.add_column('task_order', sa.Column('clin_1003', sa.Integer(), nullable=True))
|
||||
op.add_column('task_order', sa.Column('clin_2001', sa.Integer(), nullable=True))
|
||||
op.add_column('task_order', sa.Column('clin_2003', sa.Integer(), nullable=True))
|
||||
op.add_column('task_order', sa.Column('funding_type', sa.String(), nullable=True))
|
||||
op.add_column('task_order', sa.Column('funding_type_other', sa.String(), nullable=True))
|
||||
op.add_column('task_order', sa.Column('source', sa.String(), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('task_order', 'source')
|
||||
op.drop_column('task_order', 'funding_type_other')
|
||||
op.drop_column('task_order', 'funding_type')
|
||||
op.drop_column('task_order', 'clin_2003')
|
||||
op.drop_column('task_order', 'clin_2001')
|
||||
op.drop_column('task_order', 'clin_1003')
|
||||
op.drop_column('task_order', 'clin_1001')
|
||||
op.drop_column('task_order', 'clin_0003')
|
||||
op.drop_column('task_order', 'clin_0001')
|
||||
# ### end Alembic commands ###
|
@ -1,10 +1,32 @@
|
||||
from sqlalchemy import Column, Integer, String
|
||||
from enum import Enum
|
||||
|
||||
from sqlalchemy import Column, Integer, String, Enum as SQLAEnum
|
||||
|
||||
from atst.models import Base
|
||||
|
||||
class Source(Enum):
|
||||
MANUAL = "Manual"
|
||||
EDA = "eda"
|
||||
|
||||
|
||||
class FundingType(Enum):
|
||||
RDTE = "RDTE"
|
||||
OM = "OM"
|
||||
PROC = "PROC"
|
||||
OTHER = "OTHER"
|
||||
|
||||
|
||||
class TaskOrder(Base):
|
||||
__tablename__ = "task_order"
|
||||
|
||||
id = Column(Integer, primary_key=True)
|
||||
number = Column(String)
|
||||
source = Column(SQLAEnum(Source))
|
||||
funding_type = Column(SQLAEnum(FundingType))
|
||||
funding_type_other = Column(String)
|
||||
clin_0001 = Column(Integer)
|
||||
clin_0003 = Column(Integer)
|
||||
clin_1001 = Column(Integer)
|
||||
clin_1003 = Column(Integer)
|
||||
clin_2001 = Column(Integer)
|
||||
clin_2003 = Column(Integer)
|
||||
|
Loading…
x
Reference in New Issue
Block a user