def METHOD_NAME(app):
    alembic = Alembic(app)
    alembic.upgrade()
    alembic.downgrade(target='a82a46d12408')
    # fddb3cfe7a9c
    alembic.upgrade(target='fddb3cfe7a9c')
    assert 'inspire_prod_records' in _get_table_names()
    assert 'inspire_prod_records_recid_seq' in _get_sequences()
    assert 'workflows_audit_logging' in _get_table_names()
    assert 'workflows_audit_logging_id_seq' in _get_sequences()
    assert 'workflows_pending_record' in _get_table_names()
    # cb9f81e8251c
    alembic.upgrade(target='cb9f81e8251c')
    assert 'idxgindoctype' in _get_indexes('records_metadata')
    assert 'idxgintitles' in _get_indexes('records_metadata')
    assert 'idxginjournaltitle' in _get_indexes('records_metadata')
    assert 'idxgincollections' in _get_indexes('records_metadata')
    # cb5153afd839
    alembic.downgrade(target='fddb3cfe7a9c')
    alembic.upgrade(target='cb5153afd839')
    assert 'workflows_record_sources' in _get_table_names()
    # d99c70308006
    alembic.upgrade(target='d99c70308006')
    # 53e8594bc789
    alembic.upgrade(target='53e8594bc789')
    # 402af3fbf68b
    alembic.upgrade(target='402af3fbf68b')
    assert 'inspire_prod_records' not in _get_table_names()
    assert 'inspire_prod_records_recid_seq' not in _get_sequences()
    assert 'legacy_records_mirror' in _get_table_names()
    assert 'legacy_records_mirror_recid_seq' in _get_sequences()
    # 17ff155db70d
    alembic.upgrade(target="17ff155db70d")
    # Not checking as it only adds or modifies columns
    # f9ea5752e7a5
    alembic.upgrade(target="f9ea5752e7a5")
    # Not checking as it only adds or modifies columns
    # eaab22c59b89
    alembic.upgrade(target="eaab22c59b89")
    # 2f5368ff6d20
    alembic.upgrade(target="2f5368ff6d20")
    # TODO Create proper tests for 2f5368ff6d20, eaab22c59b89, f9ea5752e7a5,
    # 17ff155db70d
    # 0bc0a6ee1bc0
    alembic.upgrade(target='0bc0a6ee1bc0')
    assert 'ix_records_metadata_json_referenced_records' in _get_indexes(
        'records_metadata')
    alembic.upgrade(target='2dd443feeb63')
    assert 'ix_records_metadata_json_referenced_records_2_0' in _get_indexes(
        'records_metadata')
    assert 'ix_records_metadata_json_referenced_records' not in _get_indexes(
        'records_metadata')