python类drop_table()的实例源码

29353a1877ba_remove_featured_table.py 文件源码 项目:FRG-Crowdsourcing 作者: 97amarnathk 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def upgrade():
    # First, create column and fill all records with default value.
    # To avoid integrity error, the constraint non-nullable will be set after that
    op.add_column('app', sa.Column('featured', sa.Boolean, default=False))
    query = 'UPDATE "app" SET featured=false;'
    op.execute(query)
    op.alter_column('app', 'featured', nullable=False)
    query = 'UPDATE "app" SET featured=true WHERE app.id IN (SELECT app_id FROM FEATURED);'
    op.execute(query)
    op.drop_table('featured')
51d3131cf450_add_featured_table.py 文件源码 项目:FRG-Crowdsourcing 作者: 97amarnathk 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def downgrade():
    op.drop_table('featured')
4f12d8650050_add_results_table.py 文件源码 项目:FRG-Crowdsourcing 作者: 97amarnathk 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def downgrade():
    op.drop_table('result')
47dd43c1491_create_category_tabl.py 文件源码 项目:FRG-Crowdsourcing 作者: 97amarnathk 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def downgrade():
    op.drop_table('category')
1eb5febf4842_create_blogpost_table.py 文件源码 项目:FRG-Crowdsourcing 作者: 97amarnathk 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def downgrade():
   op.drop_table('blogpost')
f8bc21a0be7_add_audit_log_table.py 文件源码 项目:FRG-Crowdsourcing 作者: 97amarnathk 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def downgrade():
    op.drop_table('auditlog')
38ac962bf24d_helping_materials.py 文件源码 项目:FRG-Crowdsourcing 作者: 97amarnathk 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def downgrade():
    op.drop_table('helpingmaterial')
f16eb4eff7c_initial_revision.py 文件源码 项目:tuning-box 作者: openstack 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def downgrade():
    table_prefix = context.config.get_main_option('table_prefix')
    op.drop_table(table_prefix + 'environment_schema_values')
    op.drop_table(table_prefix + 'environment_hierarchy_level_value')
    op.drop_table(table_prefix + 'template')
    op.drop_table(table_prefix + 'schema')
    op.drop_table(table_prefix + 'environment_hierarchy_level')
    op.drop_table(table_prefix + 'environment_components')
    op.drop_table(table_prefix + 'namespace')
    op.drop_table(table_prefix + 'environment')
    op.drop_table(table_prefix + 'component')
7640f75569e8_.py 文件源码 项目:flask-api-skeleton 作者: ianunruh 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('identity')
    ### end Alembic commands ###
f40de084fd05_.py 文件源码 项目:flask-api-skeleton 作者: ianunruh 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('session')
    op.drop_table('user')
    ### end Alembic commands ###
743a0a1b5bc9_.py 文件源码 项目:bit 作者: codesmart-co 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('bit_facebook_daily_ad_insights')
    # ### end Alembic commands ###
360caaea22f0_.py 文件源码 项目:bit 作者: codesmart-co 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('bit_appsflyer_connector',
    sa.Column('connector_id', sa.Integer(), nullable=False),
    sa.Column('app_id', sa.String(length=255), nullable=True),
    sa.Column('api_token', sa.String(length=255), nullable=True),
    sa.Column('url_pat', sa.String(length=255), nullable=True),
    sa.ForeignKeyConstraint(['connector_id'], ['bit_connectors.id'], ),
    sa.PrimaryKeyConstraint('connector_id')
    )
    op.drop_table('bit_connectors_appsflyer')
    # ### end Alembic commands ###
360caaea22f0_.py 文件源码 项目:bit 作者: codesmart-co 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('bit_connectors_appsflyer',
    sa.Column('app_id', sa.VARCHAR(length=255), autoincrement=False, nullable=True),
    sa.Column('api_token', sa.VARCHAR(length=255), autoincrement=False, nullable=True),
    sa.Column('url_pat', sa.VARCHAR(length=255), autoincrement=False, nullable=True),
    sa.Column('connector_id', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.ForeignKeyConstraint(['connector_id'], [u'bit_connectors.id'], name=u'bit_connectors_appsflyer_connector_id_fkey')
    )
    op.drop_table('bit_appsflyer_connector')
    # ### end Alembic commands ###
3c663dc9e90b_.py 文件源码 项目:bit 作者: codesmart-co 项目源码 文件源码 阅读 24 收藏 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 ###
7dd23472cc3d_.py 文件源码 项目:bit 作者: codesmart-co 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('bit_analytics_identify')
    # ### end Alembic commands ###
46799507436e_.py 文件源码 项目:bit 作者: codesmart-co 项目源码 文件源码 阅读 18 收藏 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 ###
88642b45beae_.py 文件源码 项目:bit 作者: codesmart-co 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('bit_adwords_google_drive_storage')
    # ### end Alembic commands ###
6e190685693b_.py 文件源码 项目:bit 作者: codesmart-co 项目源码 文件源码 阅读 19 收藏 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 ###
7b084e67d65d_.py 文件源码 项目:bit 作者: codesmart-co 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('bit_chiter_connector')
    # ### end Alembic commands ###
84ad5a52b596_.py 文件源码 项目:bit 作者: codesmart-co 项目源码 文件源码 阅读 20 收藏 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 ###


问题


面经


文章

微信
公众号

扫码关注公众号