cb568ec81000_add_infer_concept_relations_column   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 16
dl 0
loc 30
rs 10
c 0
b 0
f 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
A upgrade() 0 8 1
A downgrade() 0 3 2
1
"""Add infer_concept_relations column.
2
3
Revision ID: cb568ec81000
4
Revises: 184f1bbcb916
5
Create Date: 2020-02-19 09:29:17.619082
6
"""
7
import sqlalchemy as sa
8
from alembic import op
9
10
# revision identifiers, used by Alembic.
11
revision = "cb568ec81000"
12
down_revision = "184f1bbcb916"
13
14
15
def upgrade():
16
    op.add_column(
17
        "concept",
18
        sa.Column(
19
            "infer_concept_relations",
20
            sa.Boolean(),
21
            nullable=False,
22
            server_default="true",
23
        ),
24
    )
25
26
27
def downgrade():
28
    with op.batch_alter_table("concept") as batch_op:
29
        batch_op.drop_column("infer_concept_relations")
30