Add the 'active' field to the 'tasks' table
This commit is contained in:
parent
de96bfee15
commit
16224076ec
33
alembic/versions/719f2d1539c8_add_active_field_to_tasks.py
Normal file
33
alembic/versions/719f2d1539c8_add_active_field_to_tasks.py
Normal file
@ -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')
|
Loading…
Reference in New Issue
Block a user