-
Notifications
You must be signed in to change notification settings - Fork 0
/
8fde055f9d29_add_driver_switch_activity_status.py
57 lines (49 loc) · 1.33 KB
/
8fde055f9d29_add_driver_switch_activity_status.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
"""Add driver switch activity status
Revision ID: 8fde055f9d29
Revises: 8fe63e4276dc
Create Date: 2020-02-15 16:46:48.890628
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "8fde055f9d29"
down_revision = "8fe63e4276dc"
branch_labels = None
depends_on = None
def upgrade():
op.drop_constraint("activityvalidationstatus", "activity")
op.alter_column(
"activity",
"validation_status",
type_=sa.Enum(
"no_activity_switch",
"driver_switch",
"unauthorized_submitter",
"conflicting_with_history",
"validated",
"pending",
"rejected",
name="activityvalidationstatus",
native_enum=False,
),
nullable=False,
)
# ### end Alembic commands ###
def downgrade():
op.drop_constraint("activityvalidationstatus", "activity")
op.alter_column(
"activity",
"validation_status",
type_=sa.Enum(
"no_activity_switch",
"unauthorized_submitter",
"conflicting_with_history",
"validated",
"pending",
"rejected",
name="activityvalidationstatus",
native_enum=False,
),
nullable=False,
)
# ### end Alembic commands ###