nopaque/migrations/versions/c384d7b3268a_.py

33 lines
931 B
Python
Raw Normal View History

"""empty message
Revision ID: c384d7b3268a
Revises: 55d2b1a82ba9
Create Date: 2021-09-14 09:11:45.409350
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'c384d7b3268a'
down_revision = '55d2b1a82ba9'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('token', sa.String(length=32), nullable=True))
op.add_column('users', sa.Column('token_expiration', sa.DateTime(), nullable=True))
op.create_index(op.f('ix_users_token'), 'users', ['token'], unique=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_users_token'), table_name='users')
op.drop_column('users', 'token_expiration')
op.drop_column('users', 'token')
# ### end Alembic commands ###