"""add_max_pending_session_count

Revision ID: 3f47af213b05
Revises: 41f332243bf9
Create Date: 2023-09-27 15:09:00.419228

"""

import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = "3f47af213b05"
down_revision = "41f332243bf9"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "keypair_resource_policies",
        sa.Column("max_pending_session_count", sa.Integer(), nullable=True),
    )
    op.add_column(
        "keypair_resource_policies",
        sa.Column(
            "max_pending_session_resource_slots",
            postgresql.JSONB(astext_type=sa.Text()),
            nullable=True,
        ),
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("keypair_resource_policies", "max_pending_session_resource_slots")
    op.drop_column("keypair_resource_policies", "max_pending_session_count")
    # ### end Alembic commands ###
