"""Add is_default field to trees

Revision ID: 003
Revises: 002
Create Date: 2026-02-01

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '003'
down_revision: Union[str, None] = '002'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    op.add_column('trees', sa.Column('is_default', sa.Boolean(), nullable=False, server_default='false'))
    op.create_index('ix_trees_is_default', 'trees', ['is_default'])


def downgrade() -> None:
    op.drop_index('ix_trees_is_default', table_name='trees')
    op.drop_column('trees', 'is_default')
