~fnux/meta.sr.ht

ref: 3a5042576b1773fecf22c078f6076fc83763fa8e meta.sr.ht/metasrht/alembic/versions/2d417400aa37_add_unique_constraint_to_user_auth_.py -rw-r--r-- 504 bytes
3a504257Drew DeVault Add unique constraint to user_auth_factor 8 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""Add unique constraint to user_auth_factor

Revision ID: 2d417400aa37
Revises: 0972ddb8d4f8
Create Date: 2020-10-05 14:17:00.638364

"""

# revision identifiers, used by Alembic.
revision = '2d417400aa37'
down_revision = '0972ddb8d4f8'

from alembic import op
import sqlalchemy as sa


def upgrade():
    op.create_unique_constraint('uq_user_auth_factor_user_id',
            'user_auth_factor', ['user_id'])


def downgrade():
    op.drop_constraint('uq_user_auth_factor_user_id', 'user_auth_factor')