@downgrades(4)
def _downgrade_v4(op):
 op.drop_index('ix_equities_fuzzy_symbol')
 op.drop_index('ix_equities_company_symbol')
 op.execute('UPDATE equities SET exchange = exchange_full')
 with op.batch_alter_table('equities') as batch_op:
  batch_op.drop_column('exchange_full')
 op.create_index('ix_equities_fuzzy_symbol', table_name='equities', columns=['fuzzy_symbol'])
 op.create_index('ix_equities_company_symbol', table_name='equities', columns=['company_symbol'])

@ downgrades ( 4 ) def _downgrade_v4 ( op ) : op . drop_index ( 'ix_equities_fuzzy_symbol' ) op . drop_index ( 'ix_equities_company_symbol' ) op . execute ( 'UPDATE equities SET exchange = exchange_full' ) with op . batch_alter_table ( 'equities' ) as batch_op : batch_op . drop_column ( 'exchange_full' ) op . create_index ( 'ix_equities_fuzzy_symbol' , table_name = 'equities' , columns = [ 'fuzzy_symbol' ] ) op . create_index ( 'ix_equities_company_symbol' , table_name = 'equities' , columns = [ 'company_symbol' ] )
downgrades assets db by copying the exchange_full column to exchange .