<filename>oarepo_oai_pmh_harvester/alembic/182e0f31cabc_more_oai_identifiers.py
#
# 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.

"""More oai-identifiers"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = '182e0f31cabc'
down_revision = 'fc0d04aeda93'
branch_labels = ()
depends_on = None


def upgrade():
    """Upgrade database."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('oarepo_oai_identifiers',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('oai_record_id', sqlalchemy_utils.types.uuid.UUIDType(), nullable=True),
                    sa.Column('oai_identifier', sa.String(length=2048), nullable=True),
                    sa.ForeignKeyConstraint(['oai_record_id'], ['oarepo_oai_record.id'], name=op.f('fk_oarepo_oai_identifiers_oai_record_id_oarepo_oai_record')),
                    sa.PrimaryKeyConstraint('id', name=op.f('pk_oarepo_oai_identifiers')),
                    sa.UniqueConstraint('oai_identifier', name=op.f('uq_oarepo_oai_identifiers_oai_identifier'))
                    )
    # ### end Alembic commands ###


def downgrade():
    """Downgrade database."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('oarepo_oai_identifiers')
    # ### end Alembic commands ###

<filename>oarepo_oai_pmh_harvester/alembic/182e0f31cabc_more_oai_identifiers.py
#
# 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.

"""More oai-identifiers"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = '182e0f31cabc'
down_revision = 'fc0d04aeda93'
branch_labels = ()
depends_on = None


def upgrade():
    """Upgrade database."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('oarepo_oai_identifiers',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('oai_record_id', sqlalchemy_utils.types.uuid.UUIDType(), nullable=True),
                    sa.Column('oai_identifier', sa.String(length=2048), nullable=True),
                    sa.ForeignKeyConstraint(['oai_record_id'], ['oarepo_oai_record.id'], name=op.f('fk_oarepo_oai_identifiers_oai_record_id_oarepo_oai_record')),
                    sa.PrimaryKeyConstraint('id', name=op.f('pk_oarepo_oai_identifiers')),
                    sa.UniqueConstraint('oai_identifier', name=op.f('uq_oarepo_oai_identifiers_oai_identifier'))
                    )
    # ### end Alembic commands ###


def downgrade():
    """Downgrade database."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('oarepo_oai_identifiers')
    # ### 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. More oai-identifiers # revision identifiers, used by Alembic. Upgrade database. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### Downgrade database. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ###