Module cab566cc7dfb_add_batch_build_table
[hide private]
[frames] | no frames]

Source Code for Module cab566cc7dfb_add_batch_build_table

 1  """add batch build table 
 2   
 3  Revision ID: cab566cc7dfb 
 4  Revises: 878d9d5311b7 
 5  Create Date: 2017-08-05 20:14:56.817954 
 6   
 7  """ 
 8   
 9  # revision identifiers, used by Alembic. 
10  revision = 'cab566cc7dfb' 
11  down_revision = '878d9d5311b7' 
12   
13  from alembic import op 
14  import sqlalchemy as sa 
15   
16   
17 -def upgrade():
18 op.create_table('batch', 19 sa.Column('id', sa.Integer(), nullable=False), 20 sa.PrimaryKeyConstraint('id') 21 ) 22 op.add_column('build', 23 sa.Column('batch_id', sa.Integer(), sa.ForeignKey('batch.id'), nullable=True) 24 )
25 26
27 -def downgrade():
28 op.drop_table('batch') 29 op.drop_column('build', 'batch_id')
30