diff --git a/migrations/versions/0021_add_job_metadata.py b/migrations/versions/0021_add_job_metadata.py index fe63b294d..a72d86c23 100644 --- a/migrations/versions/0021_add_job_metadata.py +++ b/migrations/versions/0021_add_job_metadata.py @@ -16,7 +16,10 @@ import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - please adjust! ### - op.add_column('jobs', sa.Column('notification_count', sa.Integer(), nullable=False)) + op.add_column('jobs', sa.Column('notification_count', sa.Integer(), nullable=True)) + op.get_bind() + op.execute('update jobs set notification_count = 0') + op.alter_column('jobs', 'notification_count', nullable=False) ### end Alembic commands ###