2020-05-22 16:14:52 +02:00
|
|
|
"""empty message
|
|
|
|
|
2020-05-24 19:54:12 +02:00
|
|
|
Revision ID: 10a7947fda6b
|
|
|
|
Revises: f680032cc361
|
|
|
|
Create Date: 2020-05-24 19:53:53.351545
|
2020-05-22 16:14:52 +02:00
|
|
|
|
|
|
|
"""
|
|
|
|
import sqlalchemy_utils
|
|
|
|
from alembic import op
|
|
|
|
import sqlalchemy as sa
|
|
|
|
|
|
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
2020-05-24 19:54:12 +02:00
|
|
|
revision = '10a7947fda6b'
|
|
|
|
down_revision = 'f680032cc361'
|
2020-05-22 16:14:52 +02:00
|
|
|
branch_labels = None
|
|
|
|
depends_on = None
|
|
|
|
|
|
|
|
|
|
|
|
def upgrade():
|
|
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
|
|
op.create_table('mfa_browser',
|
|
|
|
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
|
|
|
|
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
|
|
|
|
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
|
|
|
|
sa.Column('user_id', sa.Integer(), nullable=False),
|
|
|
|
sa.Column('token', sa.String(length=64), nullable=False),
|
|
|
|
sa.Column('expires', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
|
|
|
|
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='cascade'),
|
2020-05-24 19:54:12 +02:00
|
|
|
sa.PrimaryKeyConstraint('id'),
|
|
|
|
sa.UniqueConstraint('token')
|
2020-05-22 16:14:52 +02:00
|
|
|
)
|
2020-05-24 19:54:12 +02:00
|
|
|
op.add_column('users', sa.Column('last_otp', sa.String(length=12), nullable=True))
|
2020-05-22 16:14:52 +02:00
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
|
|
|
|
|
|
def downgrade():
|
|
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
2020-05-24 19:54:12 +02:00
|
|
|
op.drop_column('users', 'last_otp')
|
2020-05-22 16:14:52 +02:00
|
|
|
op.drop_table('mfa_browser')
|
|
|
|
# ### end Alembic commands ###
|