"""add "max_items" to PubsubNode

Revision ID: f9ce59cfc13f
Revises: ece2a6d7e4bb
Create Date: 2026-04-11 12:29:56.062028

"""

from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = "f9ce59cfc13f"
down_revision = "ece2a6d7e4bb"
branch_labels = None
depends_on = None


def upgrade():
    with op.batch_alter_table("pubsub_nodes", schema=None) as batch_op:
        batch_op.add_column(
            sa.Column(
                "max_items", sa.Integer(), server_default=sa.text("0"), nullable=False
            )
        )


def downgrade():
    with op.batch_alter_table("pubsub_nodes", schema=None) as batch_op:
        batch_op.drop_column("max_items")
