diff --git a/alembic/versions/719f2d1539c8_add_active_field_to_tasks.py b/alembic/versions/719f2d1539c8_add_active_field_to_tasks.py new file mode 100644 index 0000000..03fa472 --- /dev/null +++ b/alembic/versions/719f2d1539c8_add_active_field_to_tasks.py @@ -0,0 +1,33 @@ +"""Add active field to tasks + +Revision ID: 719f2d1539c8 +Revises: ac2bd309d20c +Create Date: 2020-05-20 13:01:33.239007 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '719f2d1539c8' +down_revision = 'ac2bd309d20c' +branch_labels = None +depends_on = None + + +def upgrade(): + with op.batch_alter_table('tasks') as tasks: + tasks.add_column( + sa.Column( + 'active', + sa.Boolean, + server_default=sa.sql.expression.true(), + nullable=False + ) + ) + + +def downgrade(): + with op.batch_alter_table('tasks') as tasks: + tasks.drop_column('active')