"""add JSON data field to preview files

Revision ID: 12208e50bf18
Revises: a0f668430352
Create Date: 2025-12-19 11:27:57.477880

"""

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

# revision identifiers, used by Alembic.
revision = "12208e50bf18"
down_revision = "a0f668430352"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("preview_file", schema=None) as batch_op:
        batch_op.add_column(
            sa.Column(
                "data", postgresql.JSONB(astext_type=sa.Text()), nullable=True
            )
        )

    # ### end Alembic commands ###


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

    # ### end Alembic commands ###
