#
# This file is part of Invenio.
# Copyright (C) 2016-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.

"""Create bucket id index."""

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '4a5d5b4d4c2f'
down_revision = '1ba76da94103'
branch_labels = ()
depends_on = None


def upgrade():
    """Upgrade database."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_index(op.f('ix_records_buckets_bucket_id'), 'records_buckets', ['bucket_id'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    """Downgrade database."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_records_buckets_bucket_id'), table_name='records_buckets')
    # ### end Alembic commands ###

#
# This file is part of Invenio.
# Copyright (C) 2016-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.

"""Create bucket id index."""

from alembic import op

# revision identifiers, used by Alembic.
revision = '4a5d5b4d4c2f'
down_revision = '1ba76da94103'
branch_labels = ()
depends_on = None


def upgrade():
    """Upgrade database."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_index(
        op.f('ix_records_buckets_bucket_id'),
        'records_buckets',
        ['bucket_id'],
        unique=False
    )
    # ### end Alembic commands ###


def downgrade():
    """Downgrade database."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(
        op.f('ix_records_buckets_bucket_id'),
        table_name='records_buckets'
    )
    # ### end Alembic commands ###

fix tests