"""change db wrong typo of avatar

Revision ID: afa6fecf9698
Revises: ac3eb7c593d4
Create Date: 2025-06-18 03:43:53.439566

"""

from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = "afa6fecf9698"
down_revision = "ac3eb7c593d4"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("ai_course", schema=None) as batch_op:
        batch_op.add_column(
            sa.Column(
                "course_teacher_avatar",
                sa.String(length=255),
                nullable=False,
                comment="Course teacher avatar",
            )
        )

    op.execute("UPDATE ai_course SET course_teacher_avatar = course_teacher_avator")

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("ai_course", schema=None) as batch_op:
        batch_op.drop_column("course_teacher_avatar")

    # ### end Alembic commands ###
