本文整理匯總了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 ###
示例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 ###
示例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 ###
示例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 ###
示例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__)
示例6: downgrade
# 需要導入模塊: from alembic import op [as 別名]
# 或者: from alembic.op import drop_table [as 別名]
def downgrade():
op.drop_table(tables.BuildData.__tablename__)
示例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 ###
示例8: downgrade
# 需要導入模塊: from alembic import op [as 別名]
# 或者: from alembic.op import drop_table [as 別名]
def downgrade():
op.drop_table('citizen_complaints_wpd')
示例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 ###
示例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 ###
示例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 ###
示例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 ###
示例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')
示例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 ###
示例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 ###