79ff53a30228_unique_concept_id_conceptscheme_id   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 11
dl 0
loc 25
rs 10
c 0
b 0
f 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
A downgrade() 0 3 2
A upgrade() 0 4 2
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