"""Set DB Journal to WAL

Revision ID: aa5a157c371a
Revises: c6febc7d4882
Create Date: 2021-05-07 15:20:24.524000

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'aa5a157c371a'
down_revision = 'c6febc7d4882'
branch_labels = None
depends_on = None

first_agent_version = '21.5.21'


def upgrade():
    connection = op.get_bind()
    try:
        connection.execute('PRAGMA journal_mode=WAL;')
    except:
        pass


def downgrade():
    connection = op.get_bind()
    try:
        connection.execute('PRAGMA journal_mode=DELETE;')
    except:
        pass
