當前位置: 首頁>>代碼示例>>Python>>正文


Python op.drop_table方法代碼示例

本文整理匯總了Python中alembic.op.drop_table方法的典型用法代碼示例。如果您正苦於以下問題:Python op.drop_table方法的具體用法?Python op.drop_table怎麽用?Python op.drop_table使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在alembic.op的用法示例。


在下文中一共展示了op.drop_table方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: downgrade

# 需要導入模塊: from alembic import op [as 別名]
# 或者: from alembic.op import drop_table [as 別名]
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('months',
    sa.Column('id', sa.INTEGER(), server_default=sa.text("nextval('months_id_seq'::regclass)"), nullable=False),
    sa.Column('month', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('year', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('department_id', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.ForeignKeyConstraint(['department_id'], ['departments.id'], name='months_department_id_fkey'),
    sa.PrimaryKeyConstraint('id', name='months_pkey'),
    postgresql_ignore_search_path=False
    )
    op.create_table('serviceTypes',
    sa.Column('id', sa.INTEGER(), server_default=sa.text('nextval(\'"serviceTypes_id_seq"\'::regclass)'), nullable=False),
    sa.Column('month_id', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('service_type', sa.VARCHAR(length=36), autoincrement=False, nullable=False),
    sa.Column('count', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.ForeignKeyConstraint(['month_id'], ['months.id'], name='serviceTypes_month_id_fkey'),
    sa.PrimaryKeyConstraint('id', name='serviceTypes_pkey')
    )
    op.drop_table('use_of_force_incidents')
    ### end Alembic commands ### 
開發者ID:codeforamerica,項目名稱:comport,代碼行數:23,代碼來源:875c52a485_.py

示例2: downgrade

# 需要導入模塊: from alembic import op [as 別名]
# 或者: from alembic.op import drop_table [as 別名]
def downgrade():
    bind = op.get_bind()
    session = Session(bind=bind)
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('pull_mirror', sa.Column('gitlab_id', sa.INTEGER(), nullable=True))

    for pull_mirror in session.query(PullMirror):
        pull_mirror.gitlab_id = pull_mirror.project.gitlab_id
        session.add(pull_mirror)
    session.commit()

    op.drop_constraint(None, 'pull_mirror', type_='foreignkey')
    op.drop_index(op.f('ix_pull_mirror_project_id'), table_name='pull_mirror')
    op.drop_column('pull_mirror', 'project_id')
    op.drop_index(op.f('ix_push_mirror_user_id'), table_name='push_mirror')
    op.drop_index(op.f('ix_push_mirror_project_id'), table_name='push_mirror')
    op.drop_table('push_mirror')
    op.drop_table('project')
    # ### end Alembic commands ### 
開發者ID:Salamek,項目名稱:gitlab-tools,代碼行數:21,代碼來源:19e8725e0581_.py

示例3: downgrade

# 需要導入模塊: from alembic import op [as 別名]
# 或者: from alembic.op import drop_table [as 別名]
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(op.f('fk_kernels_scaling_group_scaling_groups'), 'kernels', type_='foreignkey')
    op.drop_index(op.f('ix_kernels_scaling_group'), table_name='kernels')
    op.drop_column('kernels', 'scaling_group')
    op.drop_constraint(op.f('fk_agents_scaling_group_scaling_groups'), 'agents', type_='foreignkey')
    op.drop_index(op.f('ix_agents_scaling_group'), table_name='agents')
    op.drop_column('agents', 'scaling_group')
    op.drop_index(op.f('ix_sgroups_for_keypairs_scaling_group'), table_name='sgroups_for_keypairs')
    op.drop_index(op.f('ix_sgroups_for_keypairs_access_key'), table_name='sgroups_for_keypairs')
    op.drop_table('sgroups_for_keypairs')
    op.drop_index(op.f('ix_sgroups_for_groups_scaling_group'), table_name='sgroups_for_groups')
    op.drop_index(op.f('ix_sgroups_for_groups_group'), table_name='sgroups_for_groups')
    op.drop_table('sgroups_for_groups')
    op.drop_index(op.f('ix_sgroups_for_domains_scaling_group'), table_name='sgroups_for_domains')
    op.drop_index(op.f('ix_sgroups_for_domains_domain'), table_name='sgroups_for_domains')
    op.drop_table('sgroups_for_domains')
    op.drop_index(op.f('ix_scaling_groups_is_active'), table_name='scaling_groups')
    op.drop_table('scaling_groups')
    # ### end Alembic commands ### 
開發者ID:lablup,項目名稱:backend.ai-manager,代碼行數:22,代碼來源:9a91532c8534_add_scaling_group.py

示例4: downgrade

# 需要導入模塊: from alembic import op [as 別名]
# 或者: from alembic.op import drop_table [as 別名]
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 ### 
開發者ID:Blackyukun,項目名稱:Simpleblog,代碼行數:21,代碼來源:02cb3cfad5e8_v1_0.py

示例5: downgrade

# 需要導入模塊: from alembic import op [as 別名]
# 或者: from alembic.op import drop_table [as 別名]
def downgrade():
    op.drop_table(tables.Tasks.__tablename__)
    op.drop_table(tables.ResultMessage.__tablename__)
    op.drop_table(tables.ActiveInstance.__tablename__)
    op.drop_table(tables.BootAction.__tablename__)
    op.drop_table(tables.BootActionStatus.__tablename__) 
開發者ID:airshipit,項目名稱:drydock,代碼行數:8,代碼來源:9593a123e7c5_create_base_database_tables.py

示例6: downgrade

# 需要導入模塊: from alembic import op [as 別名]
# 或者: from alembic.op import drop_table [as 別名]
def downgrade():
    op.drop_table(tables.BuildData.__tablename__) 
開發者ID:airshipit,項目名稱:drydock,代碼行數:4,代碼來源:4a5bef3702b_create_build_data_table.py

示例7: downgrade

# 需要導入模塊: from alembic import op [as 別名]
# 或者: from alembic.op import drop_table [as 別名]
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('idx_host_time', table_name='visit_tracks')
    op.create_index('idx_host_time', 'visit_tracks', ['host_id', 'last_visit_time'], unique=True)
    op.drop_index(op.f('ix_simple_passwords_time'), table_name='simple_passwords')
    op.alter_column('identity_verify_requests', 'create_time',
                    existing_type=postgresql.TIMESTAMP(timezone=True),
                    nullable=False)
    op.create_index('idx_token', 'calendar_tokens', ['token'], unique=True)
    op.drop_table('unavailable_room_report')
    # ### end Alembic commands ### 
開發者ID:everyclass,項目名稱:everyclass-server,代碼行數:13,代碼來源:5e04dbf30fb0_first_commit_for_prod.py

示例8: downgrade

# 需要導入模塊: from alembic import op [as 別名]
# 或者: from alembic.op import drop_table [as 別名]
def downgrade():
    op.drop_table('citizen_complaints_wpd') 
開發者ID:codeforamerica,項目名稱:comport,代碼行數:4,代碼來源:0de6730e3d41_create_wpd_complaints_table.py

示例9: downgrade

# 需要導入模塊: from alembic import op [as 別名]
# 或者: from alembic.op import drop_table [as 別名]
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('use_of_force_incidents', 'received_date')
    op.drop_table('chart_blocks')
    op.drop_table('chart_block_defaults')
    ### end Alembic commands ### 
開發者ID:codeforamerica,項目名稱:comport,代碼行數:8,代碼來源:4ffa73ef2b8_.py

示例10: downgrade

# 需要導入模塊: from alembic import op [as 別名]
# 或者: from alembic.op import drop_table [as 別名]
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_departments_id'), table_name='departments')
    op.drop_table('departments')
    ### end Alembic commands ### 
開發者ID:codeforamerica,項目名稱:comport,代碼行數:7,代碼來源:1392585412d_.py

示例11: downgrade

# 需要導入模塊: from alembic import op [as 別名]
# 或者: from alembic.op import drop_table [as 別名]
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('demographic_values')
    ### end Alembic commands ### 
開發者ID:codeforamerica,項目名稱:comport,代碼行數:6,代碼來源:32d7cc46df4_.py

示例12: downgrade

# 需要導入模塊: from alembic import op [as 別名]
# 或者: from alembic.op import drop_table [as 別名]
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('links')
    ### end Alembic commands ### 
開發者ID:codeforamerica,項目名稱:comport,代碼行數:6,代碼來源:3df24031e72_.py

示例13: downgrade

# 需要導入模塊: from alembic import op [as 別名]
# 或者: from alembic.op import drop_table [as 別名]
def downgrade():
    op.drop_table('use_of_force_incidents_bpd')
    op.drop_table('citizen_complaints_bpd')
    op.drop_table('officer_involved_shootings_bpd') 
開發者ID:codeforamerica,項目名稱:comport,代碼行數:6,代碼來源:bd713215655e_.py

示例14: downgrade

# 需要導入模塊: from alembic import op [as 別名]
# 或者: from alembic.op import drop_table [as 別名]
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('denominator_values')
    ### end Alembic commands ### 
開發者ID:codeforamerica,項目名稱:comport,代碼行數:6,代碼來源:32f2dcfc96d_.py

示例15: downgrade

# 需要導入模塊: from alembic import op [as 別名]
# 或者: from alembic.op import drop_table [as 別名]
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('citizen_complaint')
    ### end Alembic commands ### 
開發者ID:codeforamerica,項目名稱:comport,代碼行數:6,代碼來源:33fcc9c4867_.py


注:本文中的alembic.op.drop_table方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。