python类drop_index()的实例源码

2e00e70316c0_link_container_and_pod_states.py 文件源码 项目:kuberdock-platform 作者: cloudlinux 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
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')))
fd235fe43a42_.py 文件源码 项目:bit 作者: codesmart-co 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
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 ###
02cb3cfad5e8_v1_0.py 文件源码 项目:Simpleblog 作者: Blackyukun 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
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 ###
7d7ec3901142_initial_schema.py 文件源码 项目:unsonic 作者: redshodan 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
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')
e3a246e0dc1_current_schema.py 文件源码 项目:incubator-airflow-old 作者: apache 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
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')
f9ebfb0b8e3d_.py 文件源码 项目:dazzar 作者: Philaeux 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
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 ###
4ab30ab0706c_.py 文件源码 项目:pyetje 作者: rorlika 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
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 ###
183533b82112_fix_callset_dbarray_mapping_individual_.py 文件源码 项目:GenomicsSampleAPIs 作者: Intel-HLS 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
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')
84e8e7526741_???.py 文件源码 项目:mini 作者: JJWSSS 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
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 ###
migrations.py 文件源码 项目:reahl 作者: reahl 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
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'])
a54c57ada3f5_removes_useless_indexes.py 文件源码 项目:gnocchi 作者: gnocchixyz 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
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")
66a893890997_add_user_table.py 文件源码 项目:CivilServant 作者: mitmedialab 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
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 ###
66a893890997_add_user_table.py 文件源码 项目:CivilServant 作者: mitmedialab 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
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 ###
66a893890997_add_user_table.py 文件源码 项目:CivilServant 作者: mitmedialab 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
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 ###
ed99772734e1_initial_revision.py 文件源码 项目:contactista 作者: singingwolfboy 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
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 ###
ffdc1a500db1_craton_inventory_init.py 文件源码 项目:craton 作者: openstack 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
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')
3c663dc9e90b_.py 文件源码 项目:bit 作者: codesmart-co 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
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 ###
f9261e027583_.py 文件源码 项目:bit 作者: codesmart-co 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
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 ###
46799507436e_.py 文件源码 项目:bit 作者: codesmart-co 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
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 ###
6e190685693b_.py 文件源码 项目:bit 作者: codesmart-co 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
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 ###
84ad5a52b596_.py 文件源码 项目:bit 作者: codesmart-co 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
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 ###
4ad33f99723a_.py 文件源码 项目:bit 作者: codesmart-co 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
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 ###
ecbe7bbcbd6c_.py 文件源码 项目:bit 作者: codesmart-co 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
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 ###
9e8429737ba0_.py 文件源码 项目:bit 作者: codesmart-co 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
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 ###
9e8429737ba0_.py 文件源码 项目:bit 作者: codesmart-co 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
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 ###
7257da855061_.py 文件源码 项目:circleci-demo-python-flask 作者: CircleCI-Public 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
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 ###
61e52d26ebea_message_blacklist.py 文件源码 项目:pushkin 作者: Nordeus 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def downgrade():
    op.drop_index(op.f('idx_message_blacklist_login_id'), table_name='message_blacklist')
    op.drop_table('message_blacklist')
e2a42bcd4c02_initial_state.py 文件源码 项目:pushkin 作者: Nordeus 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
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')
34dd0bf00472_max_users_per_device.py 文件源码 项目:pushkin 作者: Nordeus 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
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);')
948333640f64_.py 文件源码 项目:Leics 作者: LeicsFrameWork 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
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 ###


问题


面经


文章

微信
公众号

扫码关注公众号