squash migrations and use numeric type for money
This commit is contained in:
parent
c8da258d33
commit
5fe20fab83
73
alembic/versions/6172ac7b8b26_new_task_order_table.py
Normal file
73
alembic/versions/6172ac7b8b26_new_task_order_table.py
Normal file
@ -0,0 +1,73 @@
|
||||
"""new task order table
|
||||
|
||||
Revision ID: 6172ac7b8b26
|
||||
Revises: 1c1394e496a7
|
||||
Create Date: 2018-12-19 10:00:51.373083
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '6172ac7b8b26'
|
||||
down_revision = '1c1394e496a7'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('task_orders',
|
||||
sa.Column('time_created', sa.TIMESTAMP(timezone=True), server_default=sa.text('now()'), nullable=False),
|
||||
sa.Column('time_updated', sa.TIMESTAMP(timezone=True), server_default=sa.text('now()'), nullable=False),
|
||||
sa.Column('id', postgresql.UUID(as_uuid=True), server_default=sa.text('uuid_generate_v4()'), nullable=False),
|
||||
sa.Column('workspace_id', postgresql.UUID(as_uuid=True), nullable=True),
|
||||
sa.Column('user_id', postgresql.UUID(as_uuid=True), nullable=True),
|
||||
sa.Column('scope', sa.String(), nullable=True),
|
||||
sa.Column('defense_component', sa.String(), nullable=True),
|
||||
sa.Column('app_migration', sa.String(), nullable=True),
|
||||
sa.Column('native_apps', sa.String(), nullable=True),
|
||||
sa.Column('complexity', sa.ARRAY(sa.String()), nullable=True),
|
||||
sa.Column('complexity_other', sa.String(), nullable=True),
|
||||
sa.Column('dev_team', sa.ARRAY(sa.String()), nullable=True),
|
||||
sa.Column('dev_team_other', sa.String(), nullable=True),
|
||||
sa.Column('team_experience', sa.String(), nullable=True),
|
||||
sa.Column('start_date', sa.Date(), nullable=True),
|
||||
sa.Column('end_date', sa.Date(), nullable=True),
|
||||
sa.Column('clin_01', sa.Numeric(scale=2), nullable=True),
|
||||
sa.Column('clin_02', sa.Numeric(scale=2), nullable=True),
|
||||
sa.Column('clin_03', sa.Numeric(scale=2), nullable=True),
|
||||
sa.Column('clin_04', sa.Numeric(scale=2), nullable=True),
|
||||
sa.Column('ko_first_name', sa.String(), nullable=True),
|
||||
sa.Column('ko_last_name', sa.String(), nullable=True),
|
||||
sa.Column('ko_email', sa.String(), nullable=True),
|
||||
sa.Column('ko_dod_id', sa.String(), nullable=True),
|
||||
sa.Column('cor_first_name', sa.String(), nullable=True),
|
||||
sa.Column('cor_last_name', sa.String(), nullable=True),
|
||||
sa.Column('cor_email', sa.String(), nullable=True),
|
||||
sa.Column('cor_dod_id', sa.String(), nullable=True),
|
||||
sa.Column('so_first_name', sa.String(), nullable=True),
|
||||
sa.Column('so_last_name', sa.String(), nullable=True),
|
||||
sa.Column('so_email', sa.String(), nullable=True),
|
||||
sa.Column('so_dod_id', sa.String(), nullable=True),
|
||||
sa.Column('number', sa.String(), nullable=True),
|
||||
sa.Column('loa', sa.ARRAY(sa.String()), nullable=True),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
|
||||
sa.ForeignKeyConstraint(['workspace_id'], ['workspaces.id'], ),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('number')
|
||||
)
|
||||
op.alter_column('workspaces', 'request_id',
|
||||
existing_type=postgresql.UUID(),
|
||||
nullable=True)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('workspaces', 'request_id',
|
||||
existing_type=postgresql.UUID(),
|
||||
nullable=False)
|
||||
op.drop_table('task_orders')
|
||||
# ### end Alembic commands ###
|
@ -1,46 +0,0 @@
|
||||
"""new task order table
|
||||
|
||||
Revision ID: a4cb6444eb4a
|
||||
Revises: c457386dac86
|
||||
Create Date: 2018-12-13 09:17:25.406453
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'a4cb6444eb4a'
|
||||
down_revision = 'c457386dac86'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('task_orders',
|
||||
sa.Column('time_created', sa.TIMESTAMP(timezone=True), server_default=sa.text('now()'), nullable=False),
|
||||
sa.Column('time_updated', sa.TIMESTAMP(timezone=True), server_default=sa.text('now()'), nullable=False),
|
||||
sa.Column('id', postgresql.UUID(as_uuid=True), server_default=sa.text('uuid_generate_v4()'), nullable=False),
|
||||
sa.Column('number', sa.String(), nullable=True),
|
||||
sa.Column('clin_0001', sa.Integer(), nullable=True),
|
||||
sa.Column('clin_0003', sa.Integer(), nullable=True),
|
||||
sa.Column('clin_1001', sa.Integer(), nullable=True),
|
||||
sa.Column('clin_1003', sa.Integer(), nullable=True),
|
||||
sa.Column('clin_2001', sa.Integer(), nullable=True),
|
||||
sa.Column('clin_2003', sa.Integer(), nullable=True),
|
||||
sa.Column('expiration_date', sa.Date(), nullable=True),
|
||||
sa.Column('workspace_id', postgresql.UUID(as_uuid=True), nullable=True),
|
||||
sa.Column('user_id', postgresql.UUID(as_uuid=True), nullable=True),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
|
||||
sa.ForeignKeyConstraint(['workspace_id'], ['workspaces.id'], ),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('number')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('task_orders')
|
||||
# ### end Alembic commands ###
|
@ -1,32 +0,0 @@
|
||||
"""workspace request relationship is nullable
|
||||
|
||||
Revision ID: c457386dac86
|
||||
Revises: 1c1394e496a7
|
||||
Create Date: 2018-12-13 08:57:09.319288
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'c457386dac86'
|
||||
down_revision = '1c1394e496a7'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('workspaces', 'request_id',
|
||||
existing_type=postgresql.UUID(),
|
||||
nullable=True)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('workspaces', 'request_id',
|
||||
existing_type=postgresql.UUID(),
|
||||
nullable=False)
|
||||
# ### end Alembic commands ###
|
@ -1,96 +0,0 @@
|
||||
"""update task order columns
|
||||
|
||||
Revision ID: ea06f5863083
|
||||
Revises: a4cb6444eb4a
|
||||
Create Date: 2018-12-14 13:19:11.956511
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'ea06f5863083'
|
||||
down_revision = 'a4cb6444eb4a'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('task_orders', sa.Column('app_migration', sa.String(), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('clin_01', sa.Integer(), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('clin_02', sa.Integer(), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('clin_03', sa.Integer(), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('clin_04', sa.Integer(), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('complexity', sa.ARRAY(sa.String()), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('complexity_other', sa.String(), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('cor_dod_id', sa.String(), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('cor_email', sa.String(), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('cor_first_name', sa.String(), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('cor_last_name', sa.String(), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('defense_component', sa.String(), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('dev_team', sa.ARRAY(sa.String()), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('dev_team_other', sa.String(), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('end_date', sa.Date(), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('ko_dod_id', sa.String(), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('ko_email', sa.String(), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('ko_first_name', sa.String(), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('ko_last_name', sa.String(), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('loa', sa.ARRAY(sa.String()), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('native_apps', sa.String(), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('scope', sa.String(), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('so_dod_id', sa.String(), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('so_email', sa.String(), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('so_first_name', sa.String(), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('so_last_name', sa.String(), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('start_date', sa.Date(), nullable=True))
|
||||
op.add_column('task_orders', sa.Column('team_experience', sa.String(), nullable=True))
|
||||
op.drop_column('task_orders', 'expiration_date')
|
||||
op.drop_column('task_orders', 'clin_1003')
|
||||
op.drop_column('task_orders', 'clin_0001')
|
||||
op.drop_column('task_orders', 'clin_2003')
|
||||
op.drop_column('task_orders', 'clin_1001')
|
||||
op.drop_column('task_orders', 'clin_2001')
|
||||
op.drop_column('task_orders', 'clin_0003')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('task_orders', sa.Column('clin_0003', sa.INTEGER(), autoincrement=False, nullable=True))
|
||||
op.add_column('task_orders', sa.Column('clin_2001', sa.INTEGER(), autoincrement=False, nullable=True))
|
||||
op.add_column('task_orders', sa.Column('clin_1001', sa.INTEGER(), autoincrement=False, nullable=True))
|
||||
op.add_column('task_orders', sa.Column('clin_2003', sa.INTEGER(), autoincrement=False, nullable=True))
|
||||
op.add_column('task_orders', sa.Column('clin_0001', sa.INTEGER(), autoincrement=False, nullable=True))
|
||||
op.add_column('task_orders', sa.Column('clin_1003', sa.INTEGER(), autoincrement=False, nullable=True))
|
||||
op.add_column('task_orders', sa.Column('expiration_date', sa.DATE(), autoincrement=False, nullable=True))
|
||||
op.drop_column('task_orders', 'team_experience')
|
||||
op.drop_column('task_orders', 'start_date')
|
||||
op.drop_column('task_orders', 'so_last_name')
|
||||
op.drop_column('task_orders', 'so_first_name')
|
||||
op.drop_column('task_orders', 'so_email')
|
||||
op.drop_column('task_orders', 'so_dod_id')
|
||||
op.drop_column('task_orders', 'scope')
|
||||
op.drop_column('task_orders', 'native_apps')
|
||||
op.drop_column('task_orders', 'loa')
|
||||
op.drop_column('task_orders', 'ko_last_name')
|
||||
op.drop_column('task_orders', 'ko_first_name')
|
||||
op.drop_column('task_orders', 'ko_email')
|
||||
op.drop_column('task_orders', 'ko_dod_id')
|
||||
op.drop_column('task_orders', 'end_date')
|
||||
op.drop_column('task_orders', 'dev_team_other')
|
||||
op.drop_column('task_orders', 'dev_team')
|
||||
op.drop_column('task_orders', 'defense_component')
|
||||
op.drop_column('task_orders', 'cor_last_name')
|
||||
op.drop_column('task_orders', 'cor_first_name')
|
||||
op.drop_column('task_orders', 'cor_email')
|
||||
op.drop_column('task_orders', 'cor_dod_id')
|
||||
op.drop_column('task_orders', 'complexity_other')
|
||||
op.drop_column('task_orders', 'complexity')
|
||||
op.drop_column('task_orders', 'clin_04')
|
||||
op.drop_column('task_orders', 'clin_03')
|
||||
op.drop_column('task_orders', 'clin_02')
|
||||
op.drop_column('task_orders', 'clin_01')
|
||||
op.drop_column('task_orders', 'app_migration')
|
||||
# ### end Alembic commands ###
|
@ -1,4 +1,4 @@
|
||||
from sqlalchemy import Column, Integer, String, ForeignKey, Date
|
||||
from sqlalchemy import Column, Numeric, String, ForeignKey, Date
|
||||
from sqlalchemy.types import ARRAY
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
@ -27,10 +27,10 @@ class TaskOrder(Base, mixins.TimestampsMixin):
|
||||
team_experience = Column(String) # Team Experience
|
||||
start_date = Column(Date) # Period of Performance
|
||||
end_date = Column(Date)
|
||||
clin_01 = Column(Integer) # CLIN 01 : Unclassified Cloud Offerings
|
||||
clin_02 = Column(Integer) # CLIN 02: Classified Cloud Offerings
|
||||
clin_03 = Column(Integer) # CLIN 03: Unclassified Cloud Support and Assistance
|
||||
clin_04 = Column(Integer) # CLIN 04: Classified Cloud Support and Assistance
|
||||
clin_01 = Column(Numeric(scale=2))
|
||||
clin_02 = Column(Numeric(scale=2))
|
||||
clin_03 = Column(Numeric(scale=2))
|
||||
clin_04 = Column(Numeric(scale=2))
|
||||
ko_first_name = Column(String) # First Name
|
||||
ko_last_name = Column(String) # Last Name
|
||||
ko_email = Column(String) # Email
|
||||
|
Loading…
x
Reference in New Issue
Block a user