Python alembic.op.drop_table() Examples

The following are code examples for showing how to use alembic.op.drop_table(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
Project: comport   Author: codeforamerica   File: 875c52a485_.py    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 2
Project: taxonwiki   Author: philiptzou   File: 56d9d2f9ebe4_create_tables.py    MIT License 6 votes vote down vote up
def downgrade():
    op.drop_index(op.f('ix_taxon_alias_taxon_id'), table_name='taxon_alias')
    op.drop_index(op.f('ix_taxon_alias_name'), table_name='taxon_alias')
    op.drop_table('taxon_alias')
    op.drop_index(op.f('ix_taxon_author_taxon_id'), table_name='taxon_author')
    op.drop_index(op.f('ix_taxon_author_author_id'), table_name='taxon_author')
    op.drop_table('taxon_author')
    op.drop_index(
        op.f('ix_taxon_revision_taxon_id'), table_name='taxon_revision')
    op.drop_table('taxon_revision')
    op.drop_index('ix_taxon_rank_name_rank_kingdom_name', table_name='taxon')
    op.drop_index(op.f('ix_taxon_rank_name'), table_name='taxon')
    op.drop_index(op.f('ix_taxon_parent_id'), table_name='taxon')
    op.drop_index(op.f('ix_taxon_kingdom_name'), table_name='taxon')
    op.drop_index(op.f('ix_taxon_created_at'), table_name='taxon')
    op.drop_index(op.f('ix_taxon_itis_tsn'), table_name='taxon')
    op.drop_table('taxon')
    op.drop_index(op.f('ix_rank_ordinal'), table_name='rank')
    op.drop_index(op.f('ix_rank_required_parent_rank_name'), table_name='rank')
    op.drop_index(op.f('ix_rank_direct_parent_rank_name'), table_name='rank')
    op.drop_table('rank')
    op.drop_table('author')
    op.drop_table('kingdom') 
Example 3
Project: gitlab-tools   Author: Salamek   File: 19e8725e0581_.py    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 4
Project: SUMSarizer   Author: SUMSarizer   File: 4291771faa57_.py    MIT License 6 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_user_labels_user_id'), table_name='user_labels')
    op.drop_index(op.f('ix_user_labels_dataset_id'), table_name='user_labels')
    op.drop_index(op.f('ix_user_labels_datapoint_id'), table_name='user_labels')
    op.drop_table('user_labels')
    op.drop_index(op.f('ix_notes_dataset_id'), table_name='notes')
    op.drop_table('notes')
    op.drop_index(op.f('ix_labelled_datasets_user_id'), table_name='labelled_datasets')
    op.drop_index(op.f('ix_labelled_datasets_dataset_id'), table_name='labelled_datasets')
    op.drop_table('labelled_datasets')
    op.drop_index(op.f('ix_datapoints_timestamp'), table_name='datapoints')
    op.drop_index(op.f('ix_datapoints_dataset_id'), table_name='datapoints')
    op.drop_table('datapoints')
    op.drop_index(op.f('ix_study_users_user_id'), table_name='study_users')
    op.drop_index(op.f('ix_study_users_study_id'), table_name='study_users')
    op.drop_table('study_users')
    op.drop_index(op.f('ix_study_uploads_study_id'), table_name='study_uploads')
    op.drop_table('study_uploads')
    op.drop_index(op.f('ix_datasets_study_id'), table_name='datasets')
    op.drop_table('datasets')
    op.drop_table('users')
    op.drop_table('studies')
    ### end Alembic commands ### 
Example 5
Project: Simpleblog   Author: Blackyukun   File: 02cb3cfad5e8_v1_0.py    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 6
Project: flaskit   Author: elston   File: a2cd143eda28_.py    MIT License 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('users')
    # ### end Alembic commands ### 
Example 7
Project: drydock   Author: airshipit   File: 9593a123e7c5_create_base_database_tables.py    Apache License 2.0 5 votes vote down vote up
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__) 
Example 8
Project: drydock   Author: airshipit   File: 4a5bef3702b_create_build_data_table.py    Apache License 2.0 5 votes vote down vote up
def downgrade():
    op.drop_table(tables.BuildData.__tablename__) 
Example 9
Project: flasky   Author: RoseOu   File: 51f5ccfba190_comments.py    MIT License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('ix_comments_timestamp', 'comments')
    op.drop_table('comments')
    ### end Alembic commands ### 
Example 10
Project: flasky   Author: RoseOu   File: 1b966e7f4b9e_post_model.py    MIT License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('ix_posts_timestamp', 'posts')
    op.drop_table('posts')
    ### end Alembic commands ### 
Example 11
Project: flasky   Author: RoseOu   File: 2356a38169ea_followers.py    MIT License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('follows')
    ### end Alembic commands ### 
Example 12
Project: flasky   Author: RoseOu   File: 38c4e85512a9_initial_migration.py    MIT License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('ix_users_username', 'users')
    op.drop_table('users')
    op.drop_table('roles')
    ### end Alembic commands ### 
Example 13
Project: comport   Author: codeforamerica   File: 0de6730e3d41_create_wpd_complaints_table.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    op.drop_table('citizen_complaints_wpd') 
Example 14
Project: comport   Author: codeforamerica   File: 4ffa73ef2b8_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
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 ### 
Example 15
Project: comport   Author: codeforamerica   File: 1392585412d_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
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 ### 
Example 16
Project: comport   Author: codeforamerica   File: 32d7cc46df4_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('demographic_values')
    ### end Alembic commands ### 
Example 17
Project: comport   Author: codeforamerica   File: 3df24031e72_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('links')
    ### end Alembic commands ### 
Example 18
Project: comport   Author: codeforamerica   File: bd713215655e_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    op.drop_table('use_of_force_incidents_bpd')
    op.drop_table('citizen_complaints_bpd')
    op.drop_table('officer_involved_shootings_bpd') 
Example 19
Project: comport   Author: codeforamerica   File: 32f2dcfc96d_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('denominator_values')
    ### end Alembic commands ### 
Example 20
Project: comport   Author: codeforamerica   File: 33fcc9c4867_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('citizen_complaint')
    ### end Alembic commands ### 
Example 21
Project: comport   Author: codeforamerica   File: c21533f2fd07_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    op.drop_index(op.f('ix_incidents_updated_opaque_id'), table_name='incidents_updated')
    op.drop_table('incidents_updated') 
Example 22
Project: comport   Author: codeforamerica   File: c5e276c0d67f_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    op.drop_column('departments', 'is_public_pursuits')
    op.drop_table('pursuits_srpd')
    op.drop_table('citizen_complaints_srpd')
    op.drop_table('officer_involved_shootings_srpd')
    op.drop_table('use_of_force_incidents_srpd') 
Example 23
Project: comport   Author: codeforamerica   File: 17b38c3d5e7_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('serviceTypes')
    ### end Alembic commands ### 
Example 24
Project: comport   Author: codeforamerica   File: 3434f410ad7_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_users_id'), table_name='users')
    op.drop_column('users', 'type')
    op.drop_table('extractors')
    ### end Alembic commands ### 
Example 25
Project: comport   Author: codeforamerica   File: 43bdec0aeb4_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_invite_codes_id'), table_name='invite_codes')
    op.drop_table('invite_codes')
    ### end Alembic commands ### 
Example 26
Project: comport   Author: codeforamerica   File: 52eaf89477f_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('user_department_relationship_table')
    ### end Alembic commands ### 
Example 27
Project: comport   Author: codeforamerica   File: 4e4710949dd_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('chart_block_defaults')
    ### end Alembic commands ### 
Example 28
Project: comport   Author: codeforamerica   File: 331c513e8d4_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('months')
    ### end Alembic commands ### 
Example 29
Project: comport   Author: codeforamerica   File: 1a869ac514c_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('interesteds')
    ### end Alembic commands ### 
Example 30
Project: comport   Author: codeforamerica   File: 52979aa7977_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('roles')
    op.drop_table('users')
    ### end Alembic commands ### 
Example 31
Project: comport   Author: codeforamerica   File: 1826863c726a_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    op.drop_table('use_of_force_incidents_lmpd') 
Example 32
Project: comport   Author: codeforamerica   File: 4d1cde26d807_create_wpd_uof_table.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    op.drop_table('use_of_force_incidents_wpd') 
Example 33
Project: url-shortener   Author: piotr-rusin   File: f819f3f77f30_.py    MIT License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('shortenedURL')
    ### end Alembic commands ### 
Example 34
Project: myweb   Author: Busui   File: bfd8b06a3bbf_initalized.py    MIT License 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('tags_posts')
    op.drop_index(op.f('ix_posts_title'), table_name='posts')
    op.drop_index(op.f('ix_posts_timestamp'), table_name='posts')
    op.drop_index(op.f('ix_posts_reading_volume'), table_name='posts')
    op.drop_table('posts')
    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_table('tags')
    op.drop_table('link')
    op.drop_table('category_by_date')
    op.drop_table('categories')
    # ### end Alembic commands ### 
Example 35
Project: call-forwarding-flask   Author: TwilioDevEd   File: 06a8443ce88f_.py    MIT License 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('senators')
    op.drop_table('zipcodes')
    op.drop_table('states')
    # ### end Alembic commands ### 
Example 36
Project: pornote   Author: haltode   File: 04ef75b50778_.py    MIT License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('homework')
    op.drop_table('member')
    ### end Alembic commands ### 
Example 37
Project: mtanchor_demo   Author: forest-snow   File: 293c8607996c_.py    MIT License 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('update')
    op.drop_table('user')
    op.drop_table('start')
    # ### end Alembic commands ### 
Example 38
Project: vk-channelify   Author: reo7sp   File: f5f69376d382_.py    MIT License 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('disabled_channels')
    op.drop_table('channels')
    # ### end Alembic commands ### 
Example 39
Project: circleci-demo-python-flask   Author: CircleCI-Public   File: 7257da855061_.py    MIT License 5 votes vote down vote up
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 ### 
Example 40
Project: zun   Author: openstack   File: 157a0595e13e_drop_capsule_table.py    Apache License 2.0 5 votes vote down vote up
def upgrade():
    op.drop_table('capsule') 
Example 41
Project: flask-s3-save-example   Author: Jaza   File: 83da20f4d7a_.py    Apache License 2.0 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('roles_users')
    op.drop_table('user')
    op.drop_table('thingy')
    op.drop_table('role')
    ### end Alembic commands ### 
Example 42
Project: gitlab-tools   Author: Salamek   File: 56189bfb2c5f_.py    GNU General Public License v3.0 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_fingerprint_user_id'), table_name='fingerprint')
    op.drop_index(op.f('ix_fingerprint_hashed_hostname'), table_name='fingerprint')
    op.drop_table('fingerprint')
    # ### end Alembic commands ### 
Example 43
Project: gitlab-tools   Author: Salamek   File: d4841aeeb072_.py    GNU General Public License v3.0 5 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 44
Project: gitlab-tools   Author: Salamek   File: 6ea24c49b7a1_.py    GNU General Public License v3.0 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('periodic_task')
    op.drop_index(op.f('ix_periodic_tasks_ident'), table_name='periodic_tasks')
    op.drop_table('periodic_tasks')
    op.drop_table('interval_schedule')
    op.drop_table('crontab_schedule')
    # ### end Alembic commands ### 
Example 45
Project: gitlab-tools   Author: Salamek   File: 20bcb4b2673c_.py    GNU General Public License v3.0 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_task_result_push_mirror_id'), table_name='task_result')
    op.drop_index(op.f('ix_task_result_pull_mirror_id'), table_name='task_result')
    op.drop_table('task_result')
    # ### end Alembic commands ### 
Example 46
Project: quiz-extensions   Author: ucfopen   File: 203dd50e5775_.py    MIT License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('quiz')
    op.drop_table('extension')
    op.drop_table('user')
    op.drop_table('course')
    ### end Alembic commands ### 
Example 47
Project: beavy   Author: beavyHQ   File: 1d461753b2e_.py    Mozilla Public License 2.0 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('activities')
    op.drop_table('social_connection')
    op.drop_table('roles_users')
    op.drop_table('objects')
    op.drop_table('user')
    op.drop_table('role')
    ### end Alembic commands ### 
Example 48
Project: beavy   Author: beavyHQ   File: 15c488d628b_.py    Mozilla Public License 2.0 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('objects', 'title')
    op.drop_table('private_message_participants')
    ### end Alembic commands ### 
Example 49
Project: snet-marketplace-service   Author: singnet   File: 15908b8d7b1d_baseline.py    MIT License 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('payment')
    op.drop_table('order')
    # ### end Alembic commands ### 
Example 50
Project: orcid-service   Author: adsabs   File: 51f3b3b5cd5d_creating_basic_db_structure.py    MIT License 5 votes vote down vote up
def downgrade():
    op.drop_table('users') 
Example 51
Project: orcid-service   Author: adsabs   File: 07c3fe07309c_create_profile_table.py    MIT License 5 votes vote down vote up
def downgrade():
    op.drop_table('profile') 
Example 52
Project: invenio-userprofiles   Author: inveniosoftware   File: c25ef2c50ffa_create_userprofiles_tables.py    MIT License 5 votes vote down vote up
def downgrade():
    """Downgrade database."""
    op.drop_table('userprofiles_userprofile') 
Example 53
Project: lando-api   Author: mozilla-conduit   File: 77c763c1cf82_remove_landings.py    Mozilla Public License 2.0 5 votes vote down vote up
def upgrade():
    op.drop_table("landings") 
Example 54
Project: lando-api   Author: mozilla-conduit   File: 79cefec5be09_add_sec_approval_tables.py    Mozilla Public License 2.0 5 votes vote down vote up
def downgrade():
    op.drop_table("secapproval_requests") 
Example 55
Project: maubot   Author: maubot   File: d295f8dcfa64_initial_revision.py    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 56
Project: SUMSarizer   Author: SUMSarizer   File: 2289e585ec7b_.py    MIT License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_sz_job_study_id'), table_name='sz_job')
    op.drop_table('sz_job')
    ### end Alembic commands ### 
Example 57
Project: SUMSarizer   Author: SUMSarizer   File: 46ae5e506646_.py    MIT License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_column(u'users', 'password')
    op.drop_column(u'users', 'confirmed_at')
    op.drop_column(u'users', 'active')
    op.drop_table('roles_users')
    op.drop_table('role')
    ### end Alembic commands ### 
Example 58
Project: SUMSarizer   Author: SUMSarizer   File: 56c689702a23_.py    MIT License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_resultdatapoints_timestamp'), table_name='resultdatapoints')
    op.drop_index(op.f('ix_resultdatapoints_dataset_id'), table_name='resultdatapoints')
    op.drop_index(op.f('ix_resultdatapoints_datapoint_id'), table_name='resultdatapoints')
    op.drop_table('resultdatapoints')
    ### end Alembic commands ### 
Example 59
Project: backend.ai-manager   Author: lablup   File: bae1a7326e8a_add_domain_model.py    GNU Lesser General Public License v3.0 5 votes vote down vote up
def downgrade():
    op.drop_constraint(op.f('fk_users_domain_name_domains'), 'users', type_='foreignkey')
    op.drop_index(op.f('ix_users_domain_name'), table_name='users')
    op.drop_column('users', 'domain_name')
    op.drop_table('domains') 
Example 60
Project: backend.ai-manager   Author: lablup   File: 7ea324d0535b_vfolder_and_kernel.py    GNU Lesser General Public License v3.0 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('kernels', sa.Column('agent_id', sa.VARCHAR(), autoincrement=False, nullable=True))
    op.drop_constraint(op.f('fk_kernels_agent_agents'), 'kernels', type_='foreignkey')
    op.drop_index(op.f('ix_kernels_terminated_at'), table_name='kernels')
    op.drop_index(op.f('ix_kernels_status'), table_name='kernels')
    op.drop_index(op.f('ix_kernels_created_at'), table_name='kernels')
    op.drop_column('kernels', 'status_info')
    op.drop_column('kernels', 'num_queries')
    op.drop_column('kernels', 'net_tx_bytes')
    op.drop_column('kernels', 'net_rx_bytes')
    op.drop_column('kernels', 'max_mem_bytes')
    op.drop_column('kernels', 'io_write_bytes')
    op.drop_column('kernels', 'io_read_bytes')
    op.drop_column('kernels', 'cur_mem_bytes')
    op.drop_column('kernels', 'cpu_used')
    op.drop_column('kernels', 'allocated_cores')
    op.drop_column('kernels', 'agent')
    op.create_table(
        'usage',
        sa.Column('id', postgresql.UUID(), server_default=sa.text('uuid_generate_v4()'), autoincrement=False, nullable=False),
        sa.Column('access_key_id', sa.VARCHAR(length=20), autoincrement=False, nullable=True),
        sa.Column('kernel_type', sa.VARCHAR(), autoincrement=False, nullable=True),
        sa.Column('kernel_id', sa.VARCHAR(), autoincrement=False, nullable=True),
        sa.Column('started_at', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=True),
        sa.Column('terminated_at', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=True),
        sa.Column('cpu_used', sa.INTEGER(), server_default=sa.text('0'), autoincrement=False, nullable=True),
        sa.Column('mem_used', sa.INTEGER(), server_default=sa.text('0'), autoincrement=False, nullable=True),
        sa.Column('io_used', sa.INTEGER(), server_default=sa.text('0'), autoincrement=False, nullable=True),
        sa.Column('net_used', sa.INTEGER(), server_default=sa.text('0'), autoincrement=False, nullable=True),
        sa.ForeignKeyConstraint(['access_key_id'], ['keypairs.access_key'], name='fk_usage_access_key_id_keypairs'),
        sa.PrimaryKeyConstraint('id', name='pk_usage')
    )
    op.drop_table('vfolder_attachment')
    op.drop_table('vfolders')
    op.drop_table('agents')
    # ### end Alembic commands ### 
Example 61
Project: backend.ai-manager   Author: lablup   File: dbc1e053b880_add_keypair_resource_policy.py    GNU Lesser General Public License v3.0 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(op.f('fk_keypairs_resource_policy_keypair_resource_policies'),
                       'keypairs', type_='foreignkey')
    op.add_column(
        'keypairs',
        sa.Column('concurrency_limit', sa.INTEGER(),
                  autoincrement=False, nullable=True))
    op.alter_column('keypairs', 'resource_policy',
                    existing_type=sa.String(length=256),
                    type_=sa.VARCHAR(),
                    nullable=True)
    op.drop_table('keypair_resource_policies')
    default_for_unspecified.drop(op.get_bind())
    # ### end Alembic commands ### 
Example 62
Project: backend.ai-manager   Author: lablup   File: 185852ff9872_add_vfolder_permissions_table.py    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_permissions')
    # ### end Alembic commands ### 
Example 63
Project: backend.ai-manager   Author: lablup   File: 819c2b3830a9_add_user_model.py    GNU Lesser General Public License v3.0 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(op.f('fk_keypairs_user_users'), 'keypairs', type_='foreignkey')
    op.drop_column('keypairs', 'user')
    op.drop_index(op.f('ix_users_email'), table_name='users')
    op.drop_table('users')
    # ### end Alembic commands ###

    userrole.drop(op.get_bind()) 
Example 64
Project: backend.ai-manager   Author: lablup   File: 7a82e0c70122_add_group_model.py    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 65
Project: backend.ai-manager   Author: lablup   File: 5de06da3c2b5_init.py    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('usage')
    op.drop_table('kernels')
    op.drop_table('keypairs')
    # ### end Alembic commands ### 
Example 66
Project: backend.ai-manager   Author: lablup   File: 26d0c387e764_create_vfolder_invitations_table.py    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 67
Project: recruit   Author: Frank-qlu   File: da5890c2fa1d_.py    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 68
Project: holepunch   Author: CypherpunkArmory   File: c8493c83258e_baseline.py    GNU Affero General Public License v3.0 5 votes vote down vote up
def downgrade():
    op.drop_index(op.f("ix_user_email"), table_name="user")
    op.drop_table("user")
    op.drop_index(op.f("ix_tunnel_id"), table_name="tunnel")
    op.drop_table("tunnel")
    op.drop_index(op.f("ix_subdomain_name"), table_name="subdomain")
    op.drop_table("subdomain")
    pass 
Example 69
Project: holepunch   Author: CypherpunkArmory   File: 1e1c9c5d8e58_add_plan_model_to_db.py    GNU Affero General Public License v3.0 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint("user_plan_fk", "user", type_="foreignkey")
    op.alter_column(
        "user",
        "confirmed",
        existing_type=sa.BOOLEAN(),
        nullable=False,
        existing_server_default=sa.text("false"),
    )
    op.drop_column("user", "plan_id")
    op.drop_index(op.f("ix_plan_stripe_id"), table_name="plan")
    op.drop_index(op.f("ix_plan_name"), table_name="plan")
    op.drop_table("plan")
    # ### end Alembic commands ### 
Example 70
Project: Akeso   Author: ameserole   File: c7225db614c1_adding_hints_and_unlocks_tables.py    MIT License 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('unlocks')
    op.drop_table('hints')
    # ### end Alembic commands ### 
Example 71
Project: Akeso   Author: ameserole   File: cb3cfcc47e2f_base.py    MIT License 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('wrong_keys')
    op.drop_table('tracking')
    op.drop_table('tags')
    op.drop_table('solves')
    op.drop_table('keys')
    op.drop_table('files')
    op.drop_table('awards')
    op.drop_table('teams')
    op.drop_table('pages')
    op.drop_table('containers')
    op.drop_table('config')
    op.drop_table('challenges')
    # ### end Alembic commands ### 
Example 72
Project: microflack_users   Author: miguelgrinberg   File: a432eb7353a3_users_table.py    MIT License 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('users')
    # ### end Alembic commands ### 
Example 73
Project: ara-archive   Author: dmsimard   File: 002_ara_record_data.py    GNU General Public License v3.0 5 votes vote down vote up
def downgrade():
    op.drop_table('data')
    ### end Alembic commands ### 
Example 74
Project: FlaskBackend   Author: iamrajhans   File: 59b25a9d6e7b_.py    MIT License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.alter_column(u'users', 'user_id',
               existing_type=sa.VARCHAR(length=100),
               nullable=True)
    op.alter_column(u'users', 'updated_at',
               existing_type=postgresql.TIMESTAMP(),
               nullable=True)
    op.alter_column(u'users', 'name',
               existing_type=sa.VARCHAR(length=100),
               nullable=True)
    op.alter_column(u'users', 'last_name',
               existing_type=sa.VARCHAR(length=200),
               nullable=True)
    op.alter_column(u'users', 'email',
               existing_type=sa.VARCHAR(length=150),
               nullable=True)
    op.alter_column(u'users', 'created_at',
               existing_type=postgresql.TIMESTAMP(),
               nullable=True)
    op.drop_table('request_referral')
    ### end Alembic commands ### 
Example 75
Project: FlaskBackend   Author: iamrajhans   File: 8eba94c1838c_.py    MIT License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('user_session')
    ### end Alembic commands ### 
Example 76
Project: bitfinex-socket-crawler   Author: Asoul   File: 20170319214924_add_ticker.py    MIT License 5 votes vote down vote up
def downgrade():
    for currency in currency_list:
        op.drop_table('{}_ticker'.format(currency)) 
Example 77
Project: openeo-openshift-driver   Author: Open-EO   File: 9e0975c7737a_initial_jobs_database.py    Apache License 2.0 5 votes vote down vote up
def downgrade():
    op.drop_table('jobs') 
Example 78
Project: comport   Author: codeforamerica   File: 331a821cc4a_.py    BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('officer_involved_shootings',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('department_id', sa.Integer(), nullable=False),
    sa.Column('opaque_id', sa.String(length=255), nullable=False),
    sa.Column('occured_date', sa.DateTime(), nullable=True),
    sa.Column('division', sa.String(length=255), nullable=True),
    sa.Column('precinct', sa.String(length=255), nullable=True),
    sa.Column('shift', sa.String(length=255), nullable=True),
    sa.Column('beat', sa.String(length=255), nullable=True),
    sa.Column('disposition', sa.String(length=255), nullable=True),
    sa.Column('census_tract', sa.String(length=255), nullable=True),
    sa.Column('officer_force_type', sa.String(length=255), nullable=True),
    sa.Column('resident_weapon_used', sa.String(length=255), nullable=True),
    sa.Column('service_type', sa.String(length=255), nullable=True),
    sa.Column('resident_race', sa.String(length=255), nullable=True),
    sa.Column('officer_race', sa.String(length=255), nullable=True),
    sa.Column('resident_sex', sa.String(length=255), nullable=True),
    sa.Column('officer_sex', sa.String(length=255), nullable=True),
    sa.Column('officer_identifier', sa.String(length=255), nullable=True),
    sa.Column('officer_years_of_service', sa.Integer(), nullable=True),
    sa.Column('officer_age', sa.String(length=255), nullable=True),
    sa.Column('resident_age', sa.String(length=255), nullable=True),
    sa.Column('officer_condition', sa.String(length=255), nullable=True),
    sa.Column('resident_condition', sa.String(length=255), nullable=True),
    sa.ForeignKeyConstraint(['department_id'], ['departments.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('citizen_complaints',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('department_id', sa.Integer(), nullable=False),
    sa.Column('opaque_id', sa.String(length=255), nullable=False),
    sa.Column('occured_date', sa.DateTime(), nullable=True),
    sa.Column('division', sa.String(length=255), nullable=True),
    sa.Column('precinct', sa.String(length=255), nullable=True),
    sa.Column('shift', sa.String(length=255), nullable=True),
    sa.Column('beat', sa.String(length=255), nullable=True),
    sa.Column('disposition', sa.String(length=255), nullable=True),
    sa.Column('category', sa.String(length=255), nullable=True),
    sa.Column('census_tract', sa.String(length=255), nullable=True),
    sa.Column('resident_race', sa.String(length=255), nullable=True),
    sa.Column('officer_race', sa.String(length=255), nullable=True),
    sa.Column('resident_sex', sa.String(length=255), nullable=True),
    sa.Column('officer_sex', sa.String(length=255), nullable=True),
    sa.Column('officer_identifier', sa.String(length=255), nullable=True),
    sa.Column('officer_years_of_service', sa.Integer(), nullable=True),
    sa.Column('officer_age', sa.String(length=255), nullable=True),
    sa.Column('resident_age', sa.String(length=255), nullable=True),
    sa.ForeignKeyConstraint(['department_id'], ['departments.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.drop_table('citizen_complaint')
    op.add_column('use_of_force_incidents', sa.Column('officer_condition', sa.String(length=255), nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('resident_condition', sa.String(length=255), nullable=True))
    ### end Alembic commands ### 
Example 79
Project: backend.ai-manager   Author: lablup   File: 7ea324d0535b_vfolder_and_kernel.py    GNU Lesser General Public License v3.0 4 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'agents',
        sa.Column('id', sa.String(length=64), nullable=False),
        sa.Column('mem_slots', sa.Integer(), nullable=False),
        sa.Column('cpu_slots', sa.Integer(), nullable=False),
        sa.Column('gpu_slots', sa.Integer(), nullable=False),
        sa.Column('used_mem_slots', sa.Integer(), nullable=False),
        sa.Column('used_cpu_slots', sa.Integer(), nullable=False),
        sa.Column('used_gpu_slots', sa.Integer(), nullable=False),
        sa.Column('addr', sa.String(length=128), nullable=False),
        sa.Column('first_contact', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=True),
        sa.PrimaryKeyConstraint('id', name=op.f('pk_agents'))
    )
    op.create_table(
        'vfolders',
        sa.Column('id', GUID(), server_default=sa.text('uuid_generate_v4()'), nullable=False),
        sa.Column('host', sa.String(length=128), nullable=False),
        sa.Column('name', sa.String(length=64), nullable=False),
        sa.Column('max_files', sa.Integer(), nullable=True),
        sa.Column('max_size', sa.Integer(), nullable=True),
        sa.Column('num_files', sa.Integer(), nullable=True),
        sa.Column('cur_size', sa.Integer(), nullable=True),
        sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=True),
        sa.Column('last_used', sa.DateTime(timezone=True), nullable=True),
        sa.Column('belongs_to', sa.String(length=20), nullable=False),
        sa.ForeignKeyConstraint(['belongs_to'], ['keypairs.access_key'], name=op.f('fk_vfolders_belongs_to_keypairs')),
        sa.PrimaryKeyConstraint('id', name=op.f('pk_vfolders'))
    )
    op.create_table(
        'vfolder_attachment',
        sa.Column('vfolder', GUID(), nullable=False),
        sa.Column('kernel', GUID(), nullable=False),
        sa.ForeignKeyConstraint(['kernel'], ['kernels.sess_id'], name=op.f('fk_vfolder_attachment_kernel_kernels')),
        sa.ForeignKeyConstraint(['vfolder'], ['vfolders.id'], name=op.f('fk_vfolder_attachment_vfolder_vfolders')),
        sa.PrimaryKeyConstraint('vfolder', 'kernel', name=op.f('pk_vfolder_attachment'))
    )
    op.drop_table('usage')
    op.add_column('kernels', sa.Column('agent', sa.String(length=64), nullable=True))
    op.add_column('kernels', sa.Column('allocated_cores', sa.ARRAY(sa.Integer()), nullable=True))
    op.add_column('kernels', sa.Column('cpu_used', sa.BigInteger(), nullable=True))
    op.add_column('kernels', sa.Column('cur_mem_bytes', sa.BigInteger(), nullable=True))
    op.add_column('kernels', sa.Column('io_read_bytes', sa.BigInteger(), nullable=True))
    op.add_column('kernels', sa.Column('io_write_bytes', sa.BigInteger(), nullable=True))
    op.add_column('kernels', sa.Column('max_mem_bytes', sa.BigInteger(), nullable=True))
    op.add_column('kernels', sa.Column('net_rx_bytes', sa.BigInteger(), nullable=True))
    op.add_column('kernels', sa.Column('net_tx_bytes', sa.BigInteger(), nullable=True))
    op.add_column('kernels', sa.Column('num_queries', sa.BigInteger(), nullable=True))
    op.add_column('kernels', sa.Column('status_info', sa.Unicode(), nullable=True))
    op.create_index(op.f('ix_kernels_created_at'), 'kernels', ['created_at'], unique=False)
    op.create_index(op.f('ix_kernels_status'), 'kernels', ['status'], unique=False)
    op.create_index(op.f('ix_kernels_terminated_at'), 'kernels', ['terminated_at'], unique=False)
    op.create_foreign_key(op.f('fk_kernels_agent_agents'), 'kernels', 'agents', ['agent'], ['id'])
    op.drop_column('kernels', 'agent_id')
    # ### end Alembic commands ### 
Example 80
Project: backend.ai-manager   Author: lablup   File: 405aa2c39458_job_queue.py    GNU Lesser General Public License v3.0 4 votes vote down vote up
def downgrade():
    conn = op.get_bind()
    conn.execute('ALTER TYPE kernelstatus RENAME TO kernelstatus_new;')
    kernelstatus_old.create(conn)
    conn.execute(textwrap.dedent('''\
    CREATE FUNCTION kernelstatus_new_old_compare(
        old_enum_val kernelstatus, new_enum_val kernelstatus_new
    )
        RETURNS boolean AS $$
            SELECT old_enum_val::text <> new_enum_val::text;
        $$ LANGUAGE SQL IMMUTABLE;

    CREATE OPERATOR <> (
        leftarg = kernelstatus,
        rightarg = kernelstatus_new,
        procedure = kernelstatus_new_old_compare
    );

    ALTER TABLE kernels
        ALTER COLUMN "status" DROP DEFAULT,
        ALTER COLUMN "status" TYPE kernelstatus USING (
            CASE "status"::text
                WHEN 'PULLING' THEN 'PREPARING'
                WHEN 'PENDING' THEN 'PREPARING'
                ELSE "status"::text
            END
        )::kernelstatus,
        ALTER COLUMN "status" SET DEFAULT 'PREPARING'::kernelstatus;

    DROP FUNCTION kernelstatus_new_old_compare(
        old_enum_val kernelstatus, new_enum_val kernelstatus_new
    ) CASCADE;

    DROP TYPE kernelstatus_new;
    '''))

    op.drop_index(op.f('ix_kernels_type'), table_name='kernels')
    op.drop_index(op.f('ix_kernels_result'), table_name='kernels')
    op.alter_column(
        'kernels', 'agent_addr',
        existing_type=sa.VARCHAR(length=128),
        nullable=False)
    op.drop_column('kernels', 'type')
    op.drop_column('kernels', 'status_changed')
    op.drop_column('kernels', 'result')
    op.drop_column('agents', 'status_changed')
    op.drop_index(op.f('ix_kernel_dependencies_kernel_id'), table_name='kernel_dependencies')
    op.drop_index(op.f('ix_kernel_dependencies_depends_on'), table_name='kernel_dependencies')
    op.drop_table('kernel_dependencies')

    sessionresult.drop(op.get_bind())
    sessiontypes.drop(op.get_bind())