"""add sections to blog posts

Revision ID: add_sections_blog
Revises: add_blog_posts
Create Date: 2024-01-02 12:00:00.000000

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql

# revision identifiers, used by Alembic.
revision = 'add_sections_blog'
down_revision = 'add_blog_posts'  # Depends on blog_posts table migration
branch_labels = None
depends_on = None


def upgrade() -> None:
    # Add sections JSON column to blog_posts table
    op.add_column('blog_posts', sa.Column('sections', sa.JSON(), nullable=True))


def downgrade() -> None:
    # Remove sections column
    op.drop_column('blog_posts', 'sections')

