"""optional goal cols

Revision ID: 1138d225c857
Revises: 1bf9bd811903
Create Date: 2024-11-01 15:09:28.123613

"""

from typing import Sequence, Union

import sqlalchemy as sa

from alembic import op

# revision identifiers, used by Alembic.
revision: str = "1138d225c857"
down_revision: Union[str, None] = "1bf9bd811903"
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.alter_column("goal", "description", existing_type=sa.VARCHAR(), nullable=True)
    op.alter_column("goal", "strategy", existing_type=sa.VARCHAR(), nullable=True)
    op.alter_column("goal", "end_condition", existing_type=sa.VARCHAR(), nullable=True)
    op.drop_column("userpreference", "user_time_zone")
    op.drop_column("userpreference", "display_internal_monologue")
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column("userpreference", sa.Column("display_internal_monologue", sa.BOOLEAN(), autoincrement=False, nullable=True))
    op.add_column("userpreference", sa.Column("user_time_zone", sa.VARCHAR(), autoincrement=False, nullable=True))
    op.drop_index(op.f("ix_memory_id"), table_name="memory")
    op.create_index("ix_archivalmemory_id", "memory", ["id"], unique=False)
    op.alter_column("goal", "end_condition", existing_type=sa.VARCHAR(), nullable=False)
    op.alter_column("goal", "strategy", existing_type=sa.VARCHAR(), nullable=False)
    op.alter_column("goal", "description", existing_type=sa.VARCHAR(), nullable=False)
    # ### end Alembic commands ###
