-
Notifications
You must be signed in to change notification settings - Fork 0
/
2023-11-28_c08705245bb9_change_attendance_model.py
82 lines (74 loc) · 2.54 KB
/
2023-11-28_c08705245bb9_change_attendance_model.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
"""Change attendance model
Revision ID: c08705245bb9
Revises: 1a41a10159ef
Create Date: 2023-11-28 02:26:24.094276
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "c08705245bb9"
down_revision = "1a41a10159ef"
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"attendance_records", sa.Column("end_time", sa.String(), nullable=False)
)
op.add_column(
"attendance_records", sa.Column("start_time", sa.String(), nullable=False)
)
op.add_column(
"attendance_records", sa.Column("visit_date", sa.String(), nullable=False)
)
op.add_column(
"attendance_records", sa.Column("visit_day", sa.String(), nullable=False)
)
op.add_column(
"attendance_records",
sa.Column(
"visit_supervision",
sa.Enum("FULL", "PARTIAL", "UNSUPERVISED", name="supervision"),
nullable=False,
),
)
op.drop_column("attendance_records", "visitDate")
op.drop_column("attendance_records", "visitSupervision")
op.drop_column("attendance_records", "startTime")
op.drop_column("attendance_records", "endTime")
op.drop_column("attendance_records", "visitDay")
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"attendance_records",
sa.Column("visitDay", sa.VARCHAR(), autoincrement=False, nullable=False),
)
op.add_column(
"attendance_records",
sa.Column("endTime", sa.VARCHAR(), autoincrement=False, nullable=False),
)
op.add_column(
"attendance_records",
sa.Column("startTime", sa.VARCHAR(), autoincrement=False, nullable=False),
)
op.add_column(
"attendance_records",
sa.Column(
"visitSupervision",
postgresql.ENUM("FULL", "PARTIAL", "UNSUPERVISED", name="supervision"),
autoincrement=False,
nullable=False,
),
)
op.add_column(
"attendance_records",
sa.Column("visitDate", sa.VARCHAR(), autoincrement=False, nullable=False),
)
op.drop_column("attendance_records", "visit_supervision")
op.drop_column("attendance_records", "visit_day")
op.drop_column("attendance_records", "visit_date")
op.drop_column("attendance_records", "start_time")
op.drop_column("attendance_records", "end_time")
# ### end Alembic commands ###