downgrade()   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 2
nop 0
1
"""unique concept.id + conceptscheme.id
2
3
Revision ID: 79ff53a30228
4
Revises: 3e9675b35dfc
5
Create Date: 2020-09-14 12:23:22.546226
6
7
"""
8
from alembic import op
9
10
# revision identifiers, used by Alembic.
11
revision = "79ff53a30228"
12
down_revision = "3e9675b35dfc"
13
14
15
def upgrade():
16
    with op.batch_alter_table("concept") as batch_op:
17
        batch_op.create_unique_constraint(
18
            "uq_concept_concept_id_conceptscheme_id", ["concept_id", "conceptscheme_id"]
19
        )
20
21
22
def downgrade():
23
    with op.batch_alter_table("concept") as batch_op:
24
        batch_op.drop_constraint("uq_concept_concept_id_conceptscheme_id")
25