"""user tokens

Revision ID: 48178226be6a
Revises: 2970ab6257a1
Create Date: 2022-03-07 09:38:50.099777

"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "48178226be6a"
down_revision = "2970ab6257a1"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column("user", sa.Column("token", sa.String(length=32), nullable=True))
    op.add_column("user", sa.Column("token_expiration", sa.DateTime(), nullable=True))
    op.create_index(op.f("ix_user_token"), "user", ["token"], unique=True)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f("ix_user_token"), table_name="user")
    op.drop_column("user", "token_expiration")
    op.drop_column("user", "token")
    # ### end Alembic commands ###
