"""FFMPEG_VIDEO_COVER

Revision ID: e7bf423b248c
Revises: 8a00badae463
Create Date: 2026-06-02 11:38:49.326686
"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision: str = 'e7bf423b248c'
down_revision: Union[str, None] = '8a00badae463'
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('chat_generation_tasks', sa.Column('video_cover_url', sa.String(length=512), nullable=True))
    op.alter_column('chat_generation_tasks', 'created_at',
               existing_type=postgresql.TIMESTAMP(timezone=True),
               nullable=False,
               existing_server_default=sa.text('now()'))
    op.alter_column('chat_generation_tasks', 'updated_at',
               existing_type=postgresql.TIMESTAMP(timezone=True),
               nullable=False,
               existing_server_default=sa.text('now()'))
    op.add_column('generation_records', sa.Column('video_cover_url', sa.String(length=512), nullable=True))
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('generation_records', 'video_cover_url')
    op.alter_column('chat_generation_tasks', 'updated_at',
               existing_type=postgresql.TIMESTAMP(timezone=True),
               nullable=True,
               existing_server_default=sa.text('now()'))
    op.alter_column('chat_generation_tasks', 'created_at',
               existing_type=postgresql.TIMESTAMP(timezone=True),
               nullable=True,
               existing_server_default=sa.text('now()'))
    op.drop_column('chat_generation_tasks', 'video_cover_url')
    # ### end Alembic commands ###
