Python alembic.op 模块,drop_index() 实例源码

我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用alembic.op.drop_index()

项目:kuberdock-platform    作者:cloudlinux    | 项目源码 | 文件源码
def downgrade():
    op.add_column('container_states', sa.Column('pod_id', postgresql.UUID(),
                  autoincrement=False, nullable=True))
    op.create_foreign_key(u'container_states_pod_id_fkey',
                          'container_states', 'pods', ['pod_id'], ['id'])

    downgrade_data()

    op.drop_column('container_states', 'reason')
    op.drop_column('container_states', 'exit_code')
    op.drop_constraint('container_states_pod_state_id_fkey', 'container_states',
                       type_='foreignkey')
    op.drop_index('ix_pod_id_start_time', table_name='pod_states')
    op.drop_column('container_states', 'pod_state_id')
    op.execute("ALTER TABLE pod_states DROP CONSTRAINT pod_states_pkey, "
               "ADD CONSTRAINT pod_states_pkey PRIMARY KEY (pod_id, start_time);")
    op.drop_column('pod_states', 'id')
    op.execute(sa.schema.DropSequence(sa.Sequence('pod_states_id_seq')))
项目:bit    作者:codesmart-co    | 项目源码 | 文件源码
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('table_columns')
    op.drop_table('sql_metrics')
    op.drop_index(op.f('ix_bit_etl_tables_name'), table_name='bit_etl_tables')
    op.drop_table('bit_etl_tables')
    op.drop_table('tables')
    op.drop_table('slice_user')
    op.drop_table('saved_query')
    op.drop_index('ti_user_id_changed_on', table_name='query')
    op.drop_index(op.f('ix_query_results_key'), table_name='query')
    op.drop_table('query')
    op.drop_table('dashboard_user')
    op.drop_table('dashboard_slices')
    op.drop_table('url')
    op.drop_table('slices')
    op.drop_table('logs')
    op.drop_table('favstar')
    op.drop_table('dbs')
    op.drop_table('dashboards')
    op.drop_table('css_templates')
    op.drop_table('access_request')
    op.drop_table('keyvalue')
    op.drop_table('bit_etl_table_metrics')
    # ### end Alembic commands ###
项目:Simpleblog    作者:Blackyukun    | 项目源码 | 文件源码
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_likes_timestamp'), table_name='likes')
    op.drop_table('likes')
    op.drop_index(op.f('ix_comments_timestamp'), table_name='comments')
    op.drop_table('comments')
    op.drop_index(op.f('ix_posts_timestamp'), table_name='posts')
    op.drop_table('posts')
    op.drop_table('follows')
    op.drop_index(op.f('ix_conversations_timestamp'), table_name='conversations')
    op.drop_table('conversations')
    op.drop_index(op.f('ix_users_nickname'), table_name='users')
    op.drop_index(op.f('ix_users_email'), table_name='users')
    op.drop_table('users')
    op.drop_index(op.f('ix_roles_default'), table_name='roles')
    op.drop_table('roles')
    op.drop_index(op.f('ix_admin_timestamp'), table_name='admin')
    op.drop_table('admin')
    # ### end Alembic commands ###
项目:unsonic    作者:redshodan    | 项目源码 | 文件源码
def downgrade():
    op.drop_table('un_playlistusers')
    op.drop_table('un_playlisttracks')
    op.drop_table('un_playlist_images')
    op.drop_table('un_trackratings')
    op.drop_index('scrobble_user_index', table_name='un_scrobbles')
    op.drop_table('un_scrobbles')
    op.drop_table('un_roles')
    op.drop_table('un_playqueues')
    op.drop_table('un_playlists')
    op.drop_table('un_playcounts')
    op.drop_table('un_config')
    op.drop_table('un_artistratings')
    op.drop_table('un_albumratings')
    op.drop_table('un_users')
    op.drop_table('un_dbinfo')
项目:incubator-airflow-old    作者:apache    | 项目源码 | 文件源码
def downgrade():
    op.drop_table('known_event')
    op.drop_table('chart')
    op.drop_table('variable')
    op.drop_table('user')
    op.drop_index('ti_state_lkp', table_name='task_instance')
    op.drop_index('ti_pool', table_name='task_instance')
    op.drop_index('ti_dag_state', table_name='task_instance')
    op.drop_table('task_instance')
    op.drop_table('slot_pool')
    op.drop_table('sla_miss')
    op.drop_table('log')
    op.drop_table('known_event_type')
    op.drop_index('job_type_heart', table_name='job')
    op.drop_table('job')
    op.drop_table('import_error')
    op.drop_table('dag_pickle')
    op.drop_table('dag')
    op.drop_table('connection')
    op.drop_table('xcom')
项目:dazzar    作者:Philaeux    | 项目源码 | 文件源码
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_user_mix_details_refresh_date'), table_name='user_mix_details')
    op.drop_table('user_mix_details')
    op.drop_index(op.f('ix_queued_player_added'), table_name='queued_player')
    op.drop_table('queued_player')
    op.drop_table('profile_scan_info')
    op.drop_table('player_in_match')
    op.drop_table('permissions')
    op.drop_index(op.f('ix_user_nickname'), table_name='user')
    op.drop_table('user')
    op.drop_table('user_permission')
    op.drop_index(op.f('ix_match_status'), table_name='match')
    op.drop_index(op.f('ix_match_created'), table_name='match')
    op.drop_table('match')
    ### end Alembic commands ###
项目:pyetje    作者:rorlika    | 项目源码 | 文件源码
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('potocas')
    op.drop_index('ix_comments_timestamp', 'comments')
    op.drop_table('comments')
    op.drop_table('usertocas')
    op.drop_index('ix_questions_timestamp', 'questions')
    op.drop_table('questions')
    op.drop_table('follows')
    op.drop_index('ix_users_username', 'users')
    op.drop_index('ix_users_email', 'users')
    op.drop_table('users')
    op.drop_table('categories')
    op.drop_index('ix_roles_default', 'roles')
    op.drop_table('roles')
    ### end Alembic commands ###
项目:GenomicsSampleAPIs    作者:Intel-HLS    | 项目源码 | 文件源码
def downgrade():
    # Drop trigger
    op.execute(
        'DROP TRIGGER increment_num_rows_in_db_array ON callset_to_db_array_association CASCADE')
    op.drop_column(u'db_array', 'num_rows')
    op.create_table(
        'db_row',
        sa.Column('id', sa.BIGINT(), nullable=False),
        sa.Column('db_array_id', sa.BIGINT(), autoincrement=False, nullable=False),
        sa.Column('tile_row_id', sa.BIGINT(), autoincrement=False, nullable=False),
        sa.ForeignKeyConstraint(['db_array_id'],[u'db_array.id'], name=u'db_row_db_array_id_fkey'),
        sa.PrimaryKeyConstraint('id', name=u'db_row_pkey'))
    op.add_column(
        u'callset',
        sa.Column('individual_id', sa.BIGINT(), autoincrement=False, nullable=False))
    op.add_column(u'callset', sa.Column('dbrow_id', sa.BIGINT(), autoincrement=False, nullable=False))
    op.drop_constraint('callset_source_sample_id_fkey','callset', type_='foreignkey')
    op.drop_constraint('callset_target_sample_id_fkey','callset', type_='foreignkey')
    op.create_foreign_key(u'callset_individual_id_fkey','callset', 'individual', ['individual_id'], ['id'])
    op.create_foreign_key(u'callset_dbrow_id_fkey','callset', 'db_row', ['dbrow_id'], ['id'])
    op.drop_column(u'callset', 'target_sample_id')
    op.drop_column(u'callset', 'source_sample_id')
    op.drop_index('db_array_id_tile_row_id_idx',table_name='callset_to_db_array_association')
    op.drop_table('callset_to_db_array_association')
    op.drop_table('sample')
项目:mini    作者:JJWSSS    | 项目源码 | 文件源码
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_orders_orderID'), table_name='orders')
    op.drop_index(op.f('ix_orders_createDate'), table_name='orders')
    op.drop_index(op.f('ix_orders_confirmDate'), table_name='orders')
    op.drop_table('orders')
    op.drop_index(op.f('ix_comments_commentID'), table_name='comments')
    op.drop_table('comments')
    op.drop_index(op.f('ix_goods_modifyDate'), table_name='goods')
    op.drop_index(op.f('ix_goods_goodID'), table_name='goods')
    op.drop_index(op.f('ix_goods_createDate'), table_name='goods')
    op.drop_table('goods')
    op.drop_index(op.f('ix_users_userName'), table_name='users')
    op.drop_index(op.f('ix_users_userID'), table_name='users')
    op.drop_table('users')
    ### end Alembic commands ###
项目:reahl    作者:reahl    | 项目源码 | 文件源码
def change_task(self):
        # Task in elixir did not generate a row_type for use as discriminator
        self.schedule('alter', op.add_column, 'task', Column('row_type', String(40)))

        # Task in elixir's queue_id was NULLABLE, but should not be (Tasks HAVE to be in a Queue now)
        self.schedule('alter', op.alter_column, 'task', 'queue_id', nullable=True)

        # Rename of relationship foreign key Task.reserved_by_id -> reserved_by_party_id
        old_name = 'reserved_by_id'
        new_name = 'reserved_by_party_id'
        self.schedule('drop_fk', op.drop_constraint, '%s_%s_fk' % ('task', old_name), 'task')
        self.schedule('alter', op.alter_column, 'task', old_name, new_column_name=new_name)
        self.schedule('create_fk', op.create_foreign_key, fk_name('task', new_name, 'party'), 'task', 'party', [new_name], ['id'])

        self.schedule('drop_pk', op.drop_index, ix_name('task', 'reserved_by_id'))
        self.schedule('indexes', op.create_index, ix_name('task','reserved_by_party_id'), 'task', ['reserved_by_party_id'])
项目:gnocchi    作者:gnocchixyz    | 项目源码 | 文件源码
def upgrade():
    bind = op.get_bind()
    # NOTE(sileht): mysql can't delete an index on a foreign key
    # even this one is not the index used by the foreign key itself...
    # In our case we have two indexes fk_resource_history_id_resource_id and
    # and ix_resource_history_id, we want to delete only the second, but mysql
    # can't do that with a simple DROP INDEX ix_resource_history_id...
    # so we have to remove the constraint and put it back...
    if bind.engine.name == "mysql":
        op.drop_constraint("fk_resource_history_id_resource_id",
                           type_="foreignkey", table_name="resource_history")

    for table, colname in resource_tables + history_tables + other_tables:
        op.drop_index("ix_%s_%s" % (table, colname), table_name=table)

    if bind.engine.name == "mysql":
        op.create_foreign_key("fk_resource_history_id_resource_id",
                              "resource_history", "resource", ["id"], ["id"],
                              ondelete="CASCADE")
项目:CivilServant    作者:mitmedialab    | 项目源码 | 文件源码
def upgrade_development():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('users',
    sa.Column('name', sa.String(length=32), autoincrement=False, nullable=False),
    sa.Column('id', sa.String(length=32), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('first_seen', sa.DateTime(), nullable=True),
    sa.Column('last_seen', sa.DateTime(), nullable=True),
    sa.Column('user_data', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('name'),
    sa.UniqueConstraint('name')
    )
    # removed to fix merge conflict
    #op.add_column('posts', sa.Column('created_at', sa.DateTime(), nullable=True))
#    op.drop_index('posts_ibfk_1', table_name='posts')
    op.add_column('subreddits', sa.Column('created_at', sa.DateTime(), nullable=True))
    ### end Alembic commands ###
项目:CivilServant    作者:mitmedialab    | 项目源码 | 文件源码
def upgrade_test():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('users',
    sa.Column('name', sa.String(length=32), autoincrement=False, nullable=False),
    sa.Column('id', sa.String(length=32), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('first_seen', sa.DateTime(), nullable=True),
    sa.Column('last_seen', sa.DateTime(), nullable=True),
    sa.Column('user_data', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('name'),
    sa.UniqueConstraint('name')
    )
    # removed to fix merge conflict
    #op.add_column('posts', sa.Column('created_at', sa.DateTime(), nullable=True))
#    op.drop_index('posts_ibfk_1', table_name='posts')
    op.add_column('subreddits', sa.Column('created_at', sa.DateTime(), nullable=True))
    ### end Alembic commands ###
项目:CivilServant    作者:mitmedialab    | 项目源码 | 文件源码
def upgrade_production():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('users',
    sa.Column('name', sa.String(length=32), autoincrement=False, nullable=False),
    sa.Column('id', sa.String(length=32), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('first_seen', sa.DateTime(), nullable=True),
    sa.Column('last_seen', sa.DateTime(), nullable=True),
    sa.Column('user_data', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('name'),
    sa.UniqueConstraint('name')
    )
    # removed to fix merge conflict
    #op.add_column('posts', sa.Column('created_at', sa.DateTime(), nullable=True))
#    op.drop_index('posts_ibfk_1', table_name='posts')
    op.add_column('subreddits', sa.Column('created_at', sa.DateTime(), nullable=True))
    ### end Alembic commands ###
项目:contactista    作者:singingwolfboy    | 项目源码 | 文件源码
def downgrade():
    for seqname in ('contact_pronouns_position', 'contact_name_position',
                    'contact_email_position',
        ):
        op.execute(DropSequence(Sequence(seqname)))
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('contact_pronouns')
    op.drop_table('contact_name')
    op.drop_table('contact_email')
    op.drop_table('roles_users')
    op.drop_table('contact')
    op.drop_index(op.f('ix_user_username'), table_name='user')
    op.drop_table('user')
    op.drop_table('role')
    op.drop_table('pronouns')
    # ### end Alembic commands ###
项目:craton    作者:openstack    | 项目源码 | 文件源码
def downgrade():
    op.drop_table('network_interfaces')
    op.drop_index(op.f('ix_devices_labels'), table_name='labels')
    op.drop_table('labels')
    op.drop_table('network_devices')
    op.drop_table('hosts')
    op.drop_index(op.f('ix_networks_region_id'), table_name='networks')
    op.drop_index(op.f('ix_networks_cloud_id'), table_name='networks')
    op.drop_index(op.f('ix_networks_project_id'), table_name='networks')
    op.drop_index(op.f('ix_networks_cell_id'), table_name='networks')
    op.drop_table('networks')
    op.drop_index(op.f('ix_devices_region_id'), table_name='devices')
    op.drop_index(op.f('ix_devices_cloud_id'), table_name='devices')
    op.drop_index(op.f('ix_devices_project_id'), table_name='devices')
    op.drop_index(op.f('ix_devices_cell_id'), table_name='devices')
    op.drop_table('devices')
    op.drop_index(op.f('ix_cells_region_id'), table_name='cells')
    op.drop_index(op.f('ix_cells_cloud_id'), table_name='cells')
    op.drop_index(op.f('ix_cells_project_id'), table_name='cells')
    op.drop_table('cells')
    op.drop_index(op.f('ix_users_project_id'), table_name='users')
    op.drop_index(op.f('ix_regions_project_id'), table_name='regions')
    op.drop_index(op.f('ix_regions_cloud_id'), table_name='regions')
    op.drop_table('regions')
    op.drop_index(op.f('ix_clouds_project_id'), table_name='clouds')
    op.drop_table('clouds')
    op.drop_table('users')
    op.drop_table('projects')
    op.drop_index(op.f('ix_variable_keys'), table_name='variables')
    op.drop_table('variables')
    op.drop_table('variable_association')
项目:bit    作者:codesmart-co    | 项目源码 | 文件源码
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_bit_performance_report_year'), table_name='bit_performance_report')
    op.drop_index(op.f('ix_bit_performance_report_name'), table_name='bit_performance_report')
    op.drop_index(op.f('ix_bit_performance_report_month'), table_name='bit_performance_report')
    op.drop_index(op.f('ix_bit_performance_report_day'), table_name='bit_performance_report')
    op.drop_index(op.f('ix_bit_performance_report_date'), table_name='bit_performance_report')
    op.drop_index(op.f('ix_bit_performance_report_campaign_source'), table_name='bit_performance_report')
    op.drop_index(op.f('ix_bit_performance_report_campaign_name'), table_name='bit_performance_report')
    op.drop_index(op.f('ix_bit_performance_report_campaign_id'), table_name='bit_performance_report')
    op.drop_index(op.f('ix_bit_performance_report_breakdowns'), table_name='bit_performance_report')
    op.drop_table('bit_performance_report')
    # ### end Alembic commands ###
项目:bit    作者:codesmart-co    | 项目源码 | 文件源码
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('bit_facebook_daily_ad_insights', sa.Column('date_start', sa.DateTime(), nullable=True))
    op.drop_index('ix_bit_facebook_daily_ad_insights_native_id', table_name='bit_facebook_daily_ad_insights')
    op.drop_column('bit_facebook_daily_ad_insights', 'native_id')
    op.drop_column('bit_facebook_daily_ad_insights', 'campaign_id')
    # ### end Alembic commands ###
项目:bit    作者:codesmart-co    | 项目源码 | 文件源码
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_bit_facebook_ad_campaigns_status'), table_name='bit_facebook_ad_campaigns')
    op.drop_index(op.f('ix_bit_facebook_ad_campaigns_native_id'), table_name='bit_facebook_ad_campaigns')
    op.drop_table('bit_facebook_ad_campaigns')
    op.drop_index(op.f('ix_bit_facebook_ad_account_native_id'), table_name='bit_facebook_ad_account')
    op.drop_index(op.f('ix_bit_facebook_ad_account_account_id'), table_name='bit_facebook_ad_account')
    op.drop_table('bit_facebook_ad_account')
    op.drop_table('bit_facebook_connector')
    op.drop_index(op.f('ix_bit_facebook_ad_sets_status'), table_name='bit_facebook_ad_sets')
    op.drop_index(op.f('ix_bit_facebook_ad_sets_native_id'), table_name='bit_facebook_ad_sets')
    op.drop_table('bit_facebook_ad_sets')
    # ### end Alembic commands ###
项目:bit    作者:codesmart-co    | 项目源码 | 文件源码
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_bit_adwords_campaign_performance_report_impression_device'), table_name='bit_adwords_campaign_performance_report')
    op.drop_table('bit_adwords_campaign_performance_report')
    # ### end Alembic commands ###
项目:bit    作者:codesmart-co    | 项目源码 | 文件源码
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_bit_data_source_info_sync_time'), table_name='bit_data_source_info')
    op.drop_index(op.f('ix_bit_data_source_info_source'), table_name='bit_data_source_info')
    op.drop_index(op.f('ix_bit_data_source_info_name'), table_name='bit_data_source_info')
    op.drop_index(op.f('ix_bit_data_source_info_last_id'), table_name='bit_data_source_info')
    op.drop_table('bit_data_source_info')
    # ### end Alembic commands ###
项目:bit    作者:codesmart-co    | 项目源码 | 文件源码
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_bit_facebook_daily_ad_insights_impression_device_impression_device'), table_name='bit_facebook_daily_ad_insights_impression_device')
    op.drop_table('bit_facebook_daily_ad_insights_impression_device')
    # ### end Alembic commands ###
项目:bit    作者:codesmart-co    | 项目源码 | 文件源码
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_bit_facebook_ad_sets_campaign_id'), table_name='bit_facebook_ad_sets')
    op.drop_index(op.f('ix_bit_facebook_ad_sets_account_id'), table_name='bit_facebook_ad_sets')
    op.drop_column('bit_facebook_ad_sets', 'campaign_id')
    op.drop_column('bit_facebook_ad_sets', 'account_id')
    op.drop_index(op.f('ix_bit_facebook_ad_campaigns_account_id'), table_name='bit_facebook_ad_campaigns')
    op.drop_column('bit_facebook_ad_campaigns', 'account_id')
    # ### end Alembic commands ###
项目:bit    作者:codesmart-co    | 项目源码 | 文件源码
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('bit_facebook_ad',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('ad_set_id', sa.Integer(), nullable=True),
    sa.Column('native_id', sa.String(length=255), nullable=True),
    sa.Column('account_id', sa.String(length=255), nullable=True),
    sa.Column('campaign_id', sa.String(length=255), nullable=True),
    sa.Column('adset_id', sa.String(length=255), nullable=True),
    sa.Column('name', sa.String(length=255), nullable=True),
    sa.Column('bid_amount', sa.Integer(), nullable=True),
    sa.Column('bid_info', sa.String(length=255), nullable=True),
    sa.Column('bid_type', sa.String(length=255), nullable=True),
    sa.Column('configured_status', sa.String(length=255), nullable=True),
    sa.Column('effective_status', sa.String(length=255), nullable=True),
    sa.Column('status', sa.String(length=255), nullable=True),
    sa.Column('created_time', sa.DateTime(), nullable=True),
    sa.Column('updated_time', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['ad_set_id'], ['bit_facebook_ad_sets.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_bit_facebook_ad_native_id'), 'bit_facebook_ad', ['native_id'], unique=True)
    op.add_column(u'bit_facebook_ad_campaigns', sa.Column('ad_account_id', sa.Integer(), nullable=True))
    op.drop_index('ix_bit_facebook_ad_campaigns_account_id', table_name='bit_facebook_ad_campaigns')
    op.create_foreign_key(None, 'bit_facebook_ad_campaigns', 'bit_facebook_ad_account', ['ad_account_id'], ['id'])
    op.add_column(u'bit_facebook_ad_sets', sa.Column('ad_campaign_id', sa.Integer(), nullable=True))
    op.drop_index('ix_bit_facebook_ad_sets_account_id', table_name='bit_facebook_ad_sets')
    op.drop_index('ix_bit_facebook_ad_sets_campaign_id', table_name='bit_facebook_ad_sets')
    op.create_foreign_key(None, 'bit_facebook_ad_sets', 'bit_facebook_ad_campaigns', ['ad_campaign_id'], ['id'])
    # ### end Alembic commands ###
项目:bit    作者:codesmart-co    | 项目源码 | 文件源码
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'bit_facebook_ad_sets', type_='foreignkey')
    op.create_index('ix_bit_facebook_ad_sets_campaign_id', 'bit_facebook_ad_sets', ['campaign_id'], unique=True)
    op.create_index('ix_bit_facebook_ad_sets_account_id', 'bit_facebook_ad_sets', ['account_id'], unique=True)
    op.drop_column(u'bit_facebook_ad_sets', 'ad_campaign_id')
    op.drop_constraint(None, 'bit_facebook_ad_campaigns', type_='foreignkey')
    op.create_index('ix_bit_facebook_ad_campaigns_account_id', 'bit_facebook_ad_campaigns', ['account_id'], unique=True)
    op.drop_column(u'bit_facebook_ad_campaigns', 'ad_account_id')
    op.drop_index(op.f('ix_bit_facebook_ad_native_id'), table_name='bit_facebook_ad')
    op.drop_table('bit_facebook_ad')
    # ### end Alembic commands ###
项目:circleci-demo-python-flask    作者:CircleCI-Public    | 项目源码 | 文件源码
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_comments_timestamp'), table_name='comments')
    op.drop_table('comments')
    op.drop_index(op.f('ix_posts_timestamp'), table_name='posts')
    op.drop_table('posts')
    op.drop_table('follows')
    op.drop_index(op.f('ix_users_username'), table_name='users')
    op.drop_index(op.f('ix_users_email'), table_name='users')
    op.drop_table('users')
    op.drop_index(op.f('ix_roles_default'), table_name='roles')
    op.drop_table('roles')
    # ### end Alembic commands ###
项目:pushkin    作者:Nordeus    | 项目源码 | 文件源码
def downgrade():
    op.drop_index(op.f('idx_message_blacklist_login_id'), table_name='message_blacklist')
    op.drop_table('message_blacklist')
项目:pushkin    作者:Nordeus    | 项目源码 | 文件源码
def downgrade():
    op.execute(drop_func_process_user_login)
    op.execute(drop_func_get_elligible_user_message_pairs)
    op.execute(drop_func_update_user_message_last_time_sent)
    op.execute(drop_func_get_and_update_messages_to_send)
    op.execute(drop_func_get_localized_message)
    op.execute(drop_func_add_message)
    op.drop_table('user_message_last_time_sent')
    op.drop_table('message_localization')
    op.drop_index(op.f('idx_device_login_id'), table_name='device')
    op.drop_table('device')
    op.drop_table('message')
    op.drop_table('login')
项目:pushkin    作者:Nordeus    | 项目源码 | 文件源码
def downgrade():
    op.drop_index(op.f('idx_device_current_device_token'), table_name='device')
    op.drop_column('device', 'last_login_ts')

    op.execute(func_process_user_login_old)
    op.execute(create_get_elligible_user_message_pairs)
    op.execute(create_update_user_message_last_time_sent)
    op.execute(create_get_and_update_messages_to_send)

    op.execute('DROP FUNCTION IF EXISTS "keep_max_users_per_device" (int2, text, int2);')
项目:Leics    作者:LeicsFrameWork    | 项目源码 | 文件源码
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_users_username'), table_name='users')
    op.drop_table('users')
    op.drop_index(op.f('ix_roles_default'), table_name='roles')
    op.drop_table('roles')
    ### end Alembic commands ###
项目:triage    作者:dssg    | 项目源码 | 文件源码
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('predictions', schema='results')
    op.drop_table('feature_importances', schema='results')
    op.drop_table('evaluations', schema='results')
    op.drop_index(op.f('ix_results_models_model_hash'), table_name='models', schema='results')
    op.drop_table('models', schema='results')
    op.drop_table('model_groups', schema='results')
    op.drop_table('experiments', schema='results')
    op.execute('DROP SCHEMA results')
    # ### end Alembic commands ###
项目:do-portal    作者:certeu    | 项目源码 | 文件源码
def downgrade():
    op.drop_table('tags_vulnerabilities')
    op.drop_table('reports')
    op.drop_table('vulnerabilities')
    op.drop_table('samples')
    op.drop_table('fqdns_typosquats')
    op.drop_table('ah_startup_config_params')
    op.drop_table('ah_runtime_config_params')
    op.drop_table('users')
    op.drop_table('ip_ranges')
    op.drop_table('fqdns')
    op.drop_table('emails_organizations')
    op.drop_table('contacts')
    op.drop_table('contactemails_organizations')
    op.drop_table('asn')
    op.drop_table('ah_startup_configs')
    op.drop_table('ah_runtime_configs')
    op.drop_index(op.f('ix_organizations_abbreviation'),
                  table_name='organizations')
    op.drop_table('organizations')
    op.drop_table('deliverable_files')
    op.drop_table('ah_bots')
    op.drop_table('tasks_taskmeta')
    op.drop_table('tasks_groupmeta')
    op.drop_table('tags')
    op.drop_index(op.f('ix_roles_default'), table_name='roles')
    op.drop_table('roles')
    op.drop_table('report_types')
    op.drop_table('organization_groups')
    op.drop_table('emails')
    op.drop_table('deliverables')
    op.drop_table('ah_bot_types')
项目:podigger    作者:perna    | 项目源码 | 文件源码
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('ix_episode_search_vector', table_name='episode')
    op.drop_column('episode', 'search_vector')
    ### end Alembic commands ###
项目:podigger    作者:perna    | 项目源码 | 文件源码
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_tag_name'), table_name='tag')
    op.drop_column('tag', 'name')
    op.create_unique_constraint('podcast_name_key', 'podcast', ['name'])
    op.create_unique_constraint('podcast_feed_key', 'podcast', ['feed'])
    ### end Alembic commands ###
项目:podigger    作者:perna    | 项目源码 | 文件源码
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('tag', 'updated_at')
    op.drop_column('tag', 'created_at')
    op.drop_index(op.f('ix_popular_term_term'), table_name='popular_term')
    op.drop_table('popular_term')
    ### end Alembic commands ###
项目:podigger    作者:perna    | 项目源码 | 文件源码
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_unique_constraint('episode_link_key', 'episode', ['link'])
    op.drop_index(op.f('ix_episode_link'), table_name='episode')
    op.alter_column('episode', 'title',
               existing_type=sa.VARCHAR(),
               nullable=True)
    ### end Alembic commands ###
项目:podigger    作者:perna    | 项目源码 | 文件源码
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_podcast_name'), table_name='podcast')
    op.drop_index(op.f('ix_podcast_feed'), table_name='podcast')
    op.drop_table('episode')
    ### end Alembic commands ###
项目:podigger    作者:perna    | 项目源码 | 文件源码
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_tag_id'), table_name='tag')
    op.drop_index(op.f('ix_popular_term_id'), table_name='popular_term')
    op.drop_index(op.f('ix_podcast_id'), table_name='podcast')
    op.drop_index(op.f('ix_episode_id'), table_name='episode')
    op.drop_index(op.f('ix_topic_suggestion_title'), table_name='topic_suggestion')
    op.drop_index(op.f('ix_topic_suggestion_id'), table_name='topic_suggestion')
    op.drop_table('topic_suggestion')
    ### end Alembic commands ###
项目:podigger    作者:perna    | 项目源码 | 文件源码
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('popular_term', sa.Column('date_search', sa.Date(), nullable=True))
    op.create_index(op.f('ix_popular_term_date_search'), 'popular_term', ['date_search'], unique=False)
    op.drop_index('ix_popular_term_term', table_name='popular_term')
    op.create_index(op.f('ix_popular_term_term'), 'popular_term', ['term'], unique=False)
    ### end Alembic commands ###
项目:podigger    作者:perna    | 项目源码 | 文件源码
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_popular_term_term'), table_name='popular_term')
    op.create_index('ix_popular_term_term', 'popular_term', ['term'], unique=True)
    op.drop_index(op.f('ix_popular_term_date_search'), table_name='popular_term')
    op.drop_column('popular_term', 'date_search')
    ### end Alembic commands ###
项目:1ibrary-gzhu    作者:1ibrary    | 项目源码 | 文件源码
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_users_xh'), table_name='users')
    op.drop_table('users')
    # ### end Alembic commands ###
项目:1ibrary-gzhu    作者:1ibrary    | 项目源码 | 文件源码
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_hot_books_book_key'), table_name='hot_books')
    op.drop_table('hot_books')
    # ### end Alembic commands ###
项目:1ibrary-gzhu    作者:1ibrary    | 项目源码 | 文件源码
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('booklist_r')
    op.drop_table('subscribes')
    op.drop_index(op.f('ix_book_lists_user_id'), table_name='book_lists')
    op.drop_table('book_lists')
    op.drop_index(op.f('ix_books_book_key'), table_name='books')
    op.drop_table('books')
    # ### end Alembic commands ###
项目:league    作者:massgo    | 项目源码 | 文件源码
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('white_player_games')
    op.drop_table('roles')
    op.drop_table('black_player_games')
    op.drop_table('users')
    op.drop_index(op.f('ix_players_aga_id'), table_name='players')
    op.drop_table('players')
    op.drop_table('games')
    # ### end Alembic commands ###
项目:zun    作者:openstack    | 项目源码 | 文件源码
def upgrade():
    op.add_column('resource_class',
                  sa.Column('uuid', sa.String(length=36), nullable=False))
    op.create_unique_constraint('uniq_resource_class0uuid',
                                'resource_class', ['uuid'])
    op.drop_index('uniq_container0name', table_name='resource_class')
项目:retrospective-bot    作者:bayesimpact    | 项目源码 | 文件源码
def downgrade():
    op.drop_table('sprints')

    op.drop_index(op.f('ix_retrospective_items'), table_name='retrospective_items')
    op.drop_table('retrospective_items')
项目:flasky    作者:RoseOu    | 项目源码 | 文件源码
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('ix_roles_default', 'roles')
    op.drop_column('roles', 'permissions')
    op.drop_column('roles', 'default')
    ### end Alembic commands ###
项目:flasky    作者:RoseOu    | 项目源码 | 文件源码
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('ix_users_email', 'users')
    op.drop_column('users', 'password_hash')
    op.drop_column('users', 'email')
    ### end Alembic commands ###
项目:flasky    作者:RoseOu    | 项目源码 | 文件源码
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('ix_comments_timestamp', 'comments')
    op.drop_table('comments')
    ### end Alembic commands ###
项目:flasky    作者:RoseOu    | 项目源码 | 文件源码
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('ix_users_username', 'users')
    op.drop_table('users')
    op.drop_table('roles')
    ### end Alembic commands ###