Procházet zdrojové kódy

Add 'active' to consumption_types

Maarten van den Berg %!s(int64=5) %!d(string=před) roky
rodič
revize
ec8ea0cb18

+ 26 - 0
piket_server/alembic/versions/2f3a49058a67_add_consumption_type_active.py

@@ -0,0 +1,26 @@
1
+"""empty message
2
+
3
+Revision ID: 2f3a49058a67
4
+Revises: b4f944f8dcf6
5
+Create Date: 2019-07-29 18:20:22.101489
6
+
7
+"""
8
+from alembic import op
9
+import sqlalchemy as sa
10
+
11
+
12
+# revision identifiers, used by Alembic.
13
+revision = "2f3a49058a67"
14
+down_revision = "b4f944f8dcf6"
15
+branch_labels = None
16
+depends_on = None
17
+
18
+
19
+def upgrade():
20
+    with op.batch_alter_table("consumption_types") as batch_op:
21
+        batch_op.add_column(sa.Column("active", sa.BOOLEAN, default=True))
22
+
23
+
24
+def downgrade():
25
+    with op.batch_alter_table("consumption_types") as batch_op:
26
+        batch_op.drop_column("active")