Python alembic.op.drop_table() Examples

The following are 30 code examples of alembic.op.drop_table(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module alembic.op , or try the search function .
Example #1
Source File: d4841aeeb072_.py    From gitlab-tools with GNU General Public License v3.0 6 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('task_result', sa.Column('traceback', sa.TEXT(), autoincrement=False, nullable=True))
    op.add_column('task_result', sa.Column('task_id', sa.VARCHAR(length=155), autoincrement=False, nullable=True))
    op.add_column('task_result', sa.Column('date_done', postgresql.TIMESTAMP(), autoincrement=False, nullable=True))
    op.add_column('task_result', sa.Column('status', sa.VARCHAR(length=50), autoincrement=False, nullable=True))
    op.add_column('task_result', sa.Column('result', postgresql.BYTEA(), autoincrement=False, nullable=True))
    op.drop_constraint(None, 'task_result', type_='foreignkey')
    op.create_unique_constraint('task_result_task_id_key', 'task_result', ['task_id'])
    op.drop_index(op.f('ix_task_result_celery_taskmeta_id'), table_name='task_result')
    op.drop_column('task_result', 'celery_taskmeta_id')
    op.drop_table('celery_tasksetmeta')
    op.drop_table('celery_taskmeta')
    # ### end Alembic commands ### 
Example #2
Source File: 19e8725e0581_.py    From gitlab-tools with GNU General Public License v3.0 6 votes vote down vote up
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 ### 
Example #3
Source File: 9a91532c8534_add_scaling_group.py    From backend.ai-manager with GNU Lesser General Public License v3.0 6 votes vote down vote up
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 ### 
Example #4
Source File: 02cb3cfad5e8_v1_0.py    From Simpleblog with MIT License 6 votes vote down vote up
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 ### 
Example #5
Source File: 875c52a485_.py    From comport with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
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 ### 
Example #6
Source File: 7a82e0c70122_add_group_model.py    From backend.ai-manager with GNU Lesser General Public License v3.0 5 votes vote down vote up
def downgrade():
    op.drop_table('association_groups_users')
    op.drop_index(op.f('ix_groups_domain_name'), table_name='groups')
    op.drop_table('groups') 
Example #7
Source File: b20ee72fd9a4_.py    From app with MIT License 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('partner')
    # ### end Alembic commands ### 
Example #8
Source File: 2020_021023_6664d75ce3d4_.py    From app with MIT License 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'gen_email', type_='foreignkey')
    op.drop_column('gen_email', 'mailbox_id')
    op.drop_table('mailbox')
    # ### end Alembic commands ### 
Example #9
Source File: 5fa68bafae72_.py    From app with MIT License 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('forward_email')
    # ### end Alembic commands ### 
Example #10
Source File: 2020_052312_0e08145f0499_.py    From app with MIT License 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('domain_deleted_alias')
    # ### end Alembic commands ### 
Example #11
Source File: 002_ara_record_data.py    From ara-archive with GNU General Public License v3.0 5 votes vote down vote up
def downgrade():
    op.drop_table('data')
    ### end Alembic commands ### 
Example #12
Source File: 8a3b10926153_create_deploy_keys_table.py    From pagure with GNU General Public License v2.0 5 votes vote down vote up
def downgrade():
    op.drop_index(op.f('ix_deploykeys_deploykeys_creator_user_id'), table_name='deploykeys')
    op.drop_table('deploykeys') 
Example #13
Source File: 26d0c387e764_create_vfolder_invitations_table.py    From backend.ai-manager with GNU Lesser General Public License v3.0 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('vfolder_invitations')
    # ### end Alembic commands ### 
Example #14
Source File: 8e660aa31fe3_add_resource_presets.py    From backend.ai-manager with GNU Lesser General Public License v3.0 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('resource_presets')
    # ### end Alembic commands ### 
Example #15
Source File: da5890c2fa1d_.py    From recruit with Apache License 2.0 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('user')
    op.drop_table('cms_user')
    # ### end Alembic commands ### 
Example #16
Source File: a13967424130_add_pr_tags_table.py    From pagure with GNU General Public License v2.0 5 votes vote down vote up
def downgrade():
    """ Delete the tags_pull_requests table. """
    op.drop_table('tags_pull_requests') 
Example #17
Source File: 2b626a16542e_commit_flag.py    From pagure with GNU General Public License v2.0 5 votes vote down vote up
def downgrade():
    ''' Drop the commit_flags table. '''

    op.drop_table('commit_flags') 
Example #18
Source File: d295f8dcfa64_initial_revision.py    From maubot with GNU Affero General Public License v3.0 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('plugin')
    op.drop_table('client')
    # ### end Alembic commands ### 
Example #19
Source File: 2020_041911_dd911f880b75_.py    From app with MIT License 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('file', 'user_id',
               existing_type=sa.INTEGER(),
               nullable=False)
    op.drop_table('apple_subscription')
    # ### end Alembic commands ### 
Example #20
Source File: 2020_040922_ea30c0b5b2e3_.py    From app with MIT License 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'users', type_='foreignkey')
    op.drop_column('users', 'referral_id')
    op.drop_table('referral')
    # ### end Alembic commands ### 
Example #21
Source File: 4a640c170d02_.py    From app with MIT License 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('users', sa.Column('promo_codes', sa.TEXT(), autoincrement=False, nullable=True))
    op.add_column('users', sa.Column('plan', postgresql.ENUM('free', 'trial', 'monthly', 'yearly', name='plan_enum'), server_default=sa.text("'free'::plan_enum"), autoincrement=False, nullable=False))
    op.add_column('users', sa.Column('plan_expiration', postgresql.TIMESTAMP(), autoincrement=False, nullable=True))
    op.drop_column('users', 'trial_expiration')
    op.drop_table('subscription')
    # ### end Alembic commands ### 
Example #22
Source File: 6bbda4685999_.py    From app with MIT License 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('forward_email_log')
    # ### end Alembic commands ### 
Example #23
Source File: 551c4e6d4a8b_.py    From app with MIT License 5 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('client_scope')
    op.drop_table('scope')
    # ### end Alembic commands ### 
Example #24
Source File: 2020_022722_75093e7ded27_.py    From app with MIT License 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('users', 'salt',
               existing_type=sa.VARCHAR(length=128),
               nullable=False)
    op.alter_column('users', 'password',
               existing_type=sa.VARCHAR(length=128),
               nullable=False)
    op.drop_table('social_auth')
    # ### end Alembic commands ### 
Example #25
Source File: 2020_070423_270d598c51e3_.py    From app with MIT License 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'users', type_='foreignkey')
    op.drop_constraint(None, 'users', type_='foreignkey')
    op.create_foreign_key('users_default_random_alias_domain_id_fkey', 'users', 'custom_domain', ['default_random_alias_domain_id'], ['id'])
    op.drop_column('users', 'default_random_alias_public_domain_id')
    op.drop_table('public_domain')
    # ### end Alembic commands ### 
Example #26
Source File: 2020_051710_c31cdf879ee3_.py    From app with MIT License 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('recovery_code')
    # ### end Alembic commands ### 
Example #27
Source File: 3ebfbaeb76c0_.py    From app with MIT License 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_email_change_user_id'), table_name='email_change')
    op.drop_table('email_change')
    # ### end Alembic commands ### 
Example #28
Source File: 2020_051016_bf11ab2f0a7a_.py    From app with MIT License 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('alias_mailbox')
    # ### end Alembic commands ### 
Example #29
Source File: 2020_022819_5f191273d067_.py    From app with MIT License 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('account_activation')
    # ### end Alembic commands ### 
Example #30
Source File: 2020_052319_00532ac6d4bc_.py    From app with MIT License 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('notification')
    # ### end Alembic commands ###