app-MAIL-temp/migrations/versions/2020_050717_026e7a782ed6_.py
2020-05-07 17:59:29 +02:00

44 lines
1.5 KiB
Python

"""empty message
Revision ID: 026e7a782ed6
Revises: ae94fe5c4e9f
Create Date: 2020-05-07 17:51:48.440962
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '026e7a782ed6'
down_revision = 'ae94fe5c4e9f'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('can_use_fido', sa.Boolean(), server_default='0', nullable=False))
op.add_column('users', sa.Column('fido_credential_id', sa.String(), nullable=True))
op.add_column('users', sa.Column('fido_pk', sa.String(), nullable=True))
op.add_column('users', sa.Column('fido_sign_count', sa.Integer(), nullable=True))
op.add_column('users', sa.Column('fido_uuid', sa.String(), nullable=True))
op.create_unique_constraint(None, 'users', ['fido_credential_id'])
op.create_unique_constraint(None, 'users', ['fido_pk'])
op.create_unique_constraint(None, 'users', ['fido_uuid'])
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'users', type_='unique')
op.drop_constraint(None, 'users', type_='unique')
op.drop_constraint(None, 'users', type_='unique')
op.drop_column('users', 'fido_uuid')
op.drop_column('users', 'fido_sign_count')
op.drop_column('users', 'fido_pk')
op.drop_column('users', 'fido_credential_id')
op.drop_column('users', 'can_use_fido')
# ### end Alembic commands ###