How to use the alembic.op.drop_column function in alembic

To help you get started, we’ve selected a few alembic examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fedora-infra / bodhi / alembic / versions / 13cfca635b99_add_update_date_testing_stable_.py View on Github external
def downgrade():
    op.drop_column('updates', 'date_testing')
    op.drop_column('updates', 'date_stable')
github pajbot / pajbot / alembic / versions / e54fed8855_created_a_table_for_storing_emote_stats.py View on Github external
emote_stat.count = emote.count
            emote_stat.tm_record = emote.tm_record
            emote_stat.tm_record_date = datetime.datetime.now

    for code in emote_stat_data:
        emote_stat = EmoteStats()
        emote_stat.emote_code = code
        emote_stat.count = emote_stat_data[code]["count"]
        emote_stat.tm_record = emote_stat_data[code]["tm_record"]
        emote_stat.tm_record_date = datetime.datetime.now()
        session.add(emote_stat)

    session.commit()

    op.drop_column("tb_emote", "tm_record")
    op.drop_column("tb_emote", "count")
github qlands / FormShare / alembic / versions / cacae7cd1a74_remove_yesno_field.py View on Github external
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("odkform", "form_yesno")
    # ### end Alembic commands ###
github openstack / murano / murano / db / migration / alembic_migrations / versions / 003_add_action_entry.py View on Github external
def downgrade():
    op.drop_column('task', 'action')
    op.rename_table('task', 'deployment')

    op.create_table(
        'task',
        sa.Column('id', sa.String(length=36), nullable=False))

    helpers.transform_table(
        'status', {'task_id': 'deployment_id'}, {},
        sa.Column('created', sa.DateTime(), nullable=False),
        sa.Column('updated', sa.DateTime(), nullable=False),
        sa.Column('id', sa.String(length=36), nullable=False),
        sa.Column('entity_id', sa.String(length=255), nullable=True),
        sa.Column('entity', sa.String(length=10), nullable=True),
        sa.Column('deployment_id', sa.String(length=36), nullable=True),
        sa.Column('text', sa.Text(), nullable=False),
        sa.Column('level', sa.String(length=32), nullable=False),
github indico / indico / indico / migrations / versions / 201511231127_212f3acb0b1f_add_location_information_to_events.py View on Github external
def downgrade():
    op.drop_constraint('ck_events_venue_id_if_room_id', 'events', schema='events')
    op.drop_constraint('ck_events_no_venue_name_if_venue_id', 'events', schema='events')
    op.drop_constraint('ck_events_no_custom_location_if_room', 'events', schema='events')
    op.drop_column('events', 'room_name', schema='events')
    op.drop_column('events', 'room_id', schema='events')
    op.drop_column('events', 'venue_name', schema='events')
    op.drop_column('events', 'venue_id', schema='events')
    op.drop_column('events', 'address', schema='events')
    op.drop_constraint('uq_rooms_id_location_id', 'rooms', schema='roombooking')
github fake-name / ReadableWebProxy / alembic / versions / 00038_9b782438e315_.py View on Github external
def downgrade():
	op.drop_column('nu_release_item', 'release_date')
	### end Alembic commands ###
github release-monitoring / anitya / anitya / db / migrations / versions / 921c612ba0da_model_upstream_ecosystems.py View on Github external
def downgrade():
    op.drop_constraint("FK_ECOSYSTEM_FOR_PROJECT", "projects", type_="foreignkey")
    op.drop_constraint("UNIQ_PROJECT_NAME_PER_ECOSYSTEM", "projects", type_="unique")
    op.drop_column("projects", "ecosystem_name")
github all-of-us / raw-data-repository / rdr_service / alembic / versions / bf7f784daca9_alter_metricsracecache_table_and_create_.py View on Github external
)
    op.create_index(
        "participant_summary_core_ordered_time",
        "participant_summary",
        ["enrollment_status_core_ordered_sample_time"],
        unique=False,
    )
    op.create_index("participant_sign_up_time", "participant", ["sign_up_time"], unique=False)
    op.drop_index("participant_withdrawl_sign_up_hpo", table_name="participant")
    op.add_column("metrics_race_cache", sa.Column("race_name", mysql.VARCHAR(length=255), nullable=False))
    op.add_column(
        "metrics_race_cache",
        sa.Column("race_count", mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    )
    op.drop_column("metrics_race_cache", "white")
    op.drop_column("metrics_race_cache", "prefer_not_to_answer")
    op.drop_column("metrics_race_cache", "none_of_these_fully_describe_me")
    op.drop_column("metrics_race_cache", "no_ancestry_checked")
    op.drop_column("metrics_race_cache", "native_hawaiian_other_pacific_islander")
    op.drop_column("metrics_race_cache", "multi_ancestry")
    op.drop_column("metrics_race_cache", "middle_eastern_north_african")
    op.drop_column("metrics_race_cache", "hispanic_latino_spanish")
    op.drop_column("metrics_race_cache", "black_african_american")
    op.drop_column("metrics_race_cache", "asian")
    op.drop_column("metrics_race_cache", "american_indian_alaska_native")
    op.drop_index("calendar_idx", table_name="calendar")
    # ### end Alembic commands ###
github cloudify-cosmo / cloudify-manager / resources / rest-service / cloudify / migrations / versions / 387fcd049efb_5_0_5_to_5_1.py View on Github external
def _remove_node_id_columns():
    op.drop_constraint(u'db_nodes_node_id_key', 'db_nodes', type_='unique')
    op.drop_column('db_nodes', 'node_id')
    op.drop_constraint(u'managers_node_id_key', 'managers', type_='unique')
    op.drop_column('managers', 'node_id')
    op.drop_constraint(
        u'rabbitmq_brokers_node_id_key',
        'rabbitmq_brokers',
        type_='unique')
    op.drop_column('rabbitmq_brokers', 'node_id')
github indico / indico / indico / migrations / versions / 201606020003_affd124b6de_add_event_visibility.py View on Github external
def downgrade():
    op.drop_constraint('ck_events_valid_visibility', 'events', schema='events')
    op.drop_column('events', 'visibility', schema='events')