"""add_is_published_to_bus_schedule

Revision ID: 8b3e5b0a3e67
Revises: 414da6754b1e
Create Date: 2026-01-27 17:05:19.915106

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '8b3e5b0a3e67'
down_revision: Union[str, None] = '414da6754b1e'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('bus_schedules', sa.Column('is_published', sa.Boolean(), nullable=True))
    op.execute("UPDATE bus_schedules SET is_published = false")
    op.alter_column('bus_schedules', 'is_published', nullable=False)
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('bus_schedules', 'is_published')
    # ### end Alembic commands ###

