"""Persist score and components on MealPlanItem."""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

revision = "0012"
down_revision = "0011"
branch_labels = None
depends_on = None


def upgrade() -> None:
    op.add_column("meal_plan_item", sa.Column("score", sa.Float, nullable=True))
    op.add_column(
        "meal_plan_item",
        sa.Column("components", sa.dialects.postgresql.JSONB, nullable=True),
    )


def downgrade() -> None:
    op.drop_column("meal_plan_item", "components")
    op.drop_column("meal_plan_item", "score")
