"""Change name of revoked tokens table


Revision ID: a7c6975cb343
Revises: 8e66726dca68
Create Date: 2020-09-28 16:43:12.488879

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = 'a7c6975cb343'
down_revision = '8e66726dca68'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('revoked_token',
    sa.Column('uid', sa.Integer(), nullable=False),
    sa.Column('token_id', sa.String(length=36), nullable=True),
    sa.Column('expires_at', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('uid')
    )
    op.drop_table('token_grave')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('token_grave',
    sa.Column('uid', sa.INTEGER(), autoincrement=True, nullable=False),
    sa.Column('token_id', sa.VARCHAR(length=36), autoincrement=False, nullable=True),
    sa.Column('expires_at', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('uid', name='token_grave_pkey')
    )
    op.drop_table('revoked_token')
    # ### end Alembic commands ###
