"""Add pre-pinned packages

Revision ID: 0f5f85bb2ae7
Revises: 1a83a5260664
Create Date: 2025-09-10 14:36:06.028179

"""

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

# revision identifiers, used by Alembic.
revision = "0f5f85bb2ae7"
down_revision = "1a83a5260664"
branch_labels = None
depends_on = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("taskgroupv2", schema=None) as batch_op:
        batch_op.add_column(
            sa.Column(
                "pinned_package_versions_pre",
                postgresql.JSONB(astext_type=sa.Text()),
                server_default="{}",
                nullable=True,
            )
        )

    # ### end Alembic commands ###


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

    # ### end Alembic commands ###
