"""Database revision '1c87ed320c78': Added jobs"""

from alembic import op
import sqlalchemy as sa

# pylint: disable=invalid-name
# revision identifiers, used by Alembic.
revision: str = '1c87ed320c78'
down_revision = '9698388a0709'
branch_labels = None
depends_on = None


def upgrade() -> None:
    """Upgrade the database."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'Jobs',
        sa.Column('id', sa.Uuid(), nullable=False),
        sa.Column('process_name', sa.String(length=100), nullable=False),
        sa.Column('scheduler_name', sa.String(length=100), nullable=False),
        sa.Column('start_time', sa.DateTime(), nullable=False),
        sa.Column('end_time', sa.DateTime(), nullable=True),
        sa.Column('status', sa.Enum('RUNNING', 'DONE', 'FAILED', 'KILLED', name='jobstatus'), nullable=False),
        sa.PrimaryKeyConstraint('id')
    )
    op.add_column('Logs', sa.Column('job_id', sa.Uuid(), nullable=True))
