<filename>oarepo_tokens/alembic/171069d4f96a_create_oarepo_tokens_table.py<gh_stars>0
#
# 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 oarepo_tokens table"""

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
from sqlalchemy.dialects import postgresql
import sqlalchemy_utils

# revision identifiers, used by Alembic.
revision = '171069d4f96a'
down_revision = 'fcd82d97a4c0'
branch_labels = ()
depends_on = None


def upgrade():
    """Upgrade database."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('oarepo_tokens',
    sa.Column('created', sa.DateTime().with_variant(mysql.DATETIME(fsp=6), 'mysql'), nullable=False),
    sa.Column('updated', sa.DateTime().with_variant(mysql.DATETIME(fsp=6), 'mysql'), nullable=False),
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('token', sqlalchemy_utils.types.encrypted.encrypted_type.EncryptedType(), nullable=False),
    sa.Column('pid_type', sa.String(length=6), nullable=False),
    sa.Column('pid_value', sa.String(length=255), nullable=False),
    sa.Column('not_after', sa.DateTime().with_variant(mysql.DATETIME(fsp=6), 'mysql'), nullable=True),
    sa.PrimaryKeyConstraint('id', name=op.f('pk_oarepo_tokens'))
    )
    # ### end Alembic commands ###


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

<filename>oarepo_tokens/alembic/171069d4f96a_create_oarepo_tokens_table.py<gh_stars>0
#
# 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 oarepo_tokens table"""

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
from sqlalchemy.dialects import postgresql
import sqlalchemy_utils

# revision identifiers, used by Alembic.
revision = '171069d4f96a'
down_revision = 'fcd82d97a4c0'
branch_labels = ()
depends_on = None


def upgrade():
    """Upgrade database."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('oarepo_tokens',
    sa.Column('created', sa.DateTime().with_variant(mysql.DATETIME(fsp=6), 'mysql'), nullable=False),
    sa.Column('updated', sa.DateTime().with_variant(mysql.DATETIME(fsp=6), 'mysql'), nullable=False),
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('token', sqlalchemy_utils.types.encrypted.encrypted_type.EncryptedType(), nullable=False),
    sa.Column('pid_type', sa.String(length=6), nullable=False),
    sa.Column('pid_value', sa.String(length=255), nullable=False),
    sa.Column('not_after', sa.DateTime().with_variant(mysql.DATETIME(fsp=6), 'mysql'), nullable=True),
    sa.PrimaryKeyConstraint('id', name=op.f('pk_oarepo_tokens'))
    )
    # ### end Alembic commands ###


def downgrade():
    """Downgrade database."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('oarepo_tokens')
    # ### 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 oarepo_tokens table # 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 ###