def METHOD_NAME():
    """Downgrade database."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("rdm_records_metadata_version", "media_bucket_id")
    op.drop_constraint(
        op.f("fk_rdm_records_metadata_media_bucket_id_files_bucket"),
        "rdm_records_metadata",
        type_="foreignkey",
    )
    op.drop_column("rdm_records_metadata", "media_bucket_id")
    op.drop_constraint(
        op.f("fk_rdm_drafts_metadata_media_bucket_id_files_bucket"),
        "rdm_drafts_metadata",
        type_="foreignkey",
    )
    op.drop_column("rdm_drafts_metadata", "media_bucket_id")
    op.create_index(
        "ix_uq_partial_files_object_is_head",
        "files_object",
        ["bucket_id", "key"],
        unique=False,
    )
    op.drop_index(
        "uidx_rdm_records_media_files_id_key", table_name="rdm_records_media_files"
    )
    op.drop_table("rdm_records_media_files")
    op.drop_index(
        "uidx_rdm_drafts_media_files_id_key", table_name="rdm_drafts_media_files"
    )
    op.drop_table("rdm_drafts_media_files")
    # ### end Alembic commands ###