# pylint: disable=invalid-name
"""JSON sample sizes

Revision ID: 07859b6b370b
Revises: 342f43b1c9d9
Create Date: 2021-02-18 23:06:28.697346+00:00

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "07859b6b370b"
down_revision = "342f43b1c9d9"
branch_labels = None
depends_on = None


def upgrade():
    op.alter_column(
        "round_contest",
        "sample_size",
        type_=sa.JSON,
        postgresql_using="json_build_object('key', 'custom', 'size', sample_size::int, 'prob', null)",
    )


def downgrade():  # pragma: no cover
    pass
    # ### commands auto generated by Alembic - please adjust! ###
    # ### end Alembic commands ###
