"""Add state to job

Revision ID: bfebc2d5c719
Revises: d1fb679f7eec
Create Date: 2022-06-27 14:56:58.797121

"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'bfebc2d5c719'
down_revision = 'd1fb679f7eec'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('job', sa.Column('attempts', sa.Integer(), server_default='0', nullable=False))
    op.add_column('job', sa.Column('state', sa.Integer(), server_default='0', nullable=False))
    op.add_column('job', sa.Column('taken_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True))
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('job', 'taken_at')
    op.drop_column('job', 'state')
    op.drop_column('job', 'attempts')
    # ### end Alembic commands ###
