"""introduce required_roles

Revision ID: d53dfbe96f00
Revises: b792689d4cd4
Create Date: 2024-11-27 11:15:05.624346

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = 'd53dfbe96f00'
down_revision: Union[str, None] = 'b792689d4cd4'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('RecentEngines', schema=None) as batch_op:
        batch_op.add_column(sa.Column('required_roles', sa.JSON(), nullable=False, server_default='[]'))

    with op.batch_alter_table('RecentRuns', schema=None) as batch_op:
        batch_op.add_column(sa.Column('required_roles', sa.JSON(), nullable=False, server_default='[]'))

    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('RecentRuns', schema=None) as batch_op:
        batch_op.drop_column('required_roles')

    with op.batch_alter_table('RecentEngines', schema=None) as batch_op:
        batch_op.drop_column('required_roles')
    # ### end Alembic commands ###
