"""Align the concierge details column with the PostgreSQL JSONB model type.""" from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql revision = "0035_concierge_details_jsonb" down_revision = "0034_media_assets" branch_labels = None depends_on = None def upgrade() -> None: op.alter_column( "ConciergeAdvisor", "details", existing_type=sa.JSON(), type_=postgresql.JSONB(astext_type=sa.Text()), existing_nullable=False, postgresql_using='"details"::jsonb', ) def downgrade() -> None: op.alter_column( "ConciergeAdvisor", "details", existing_type=postgresql.JSONB(astext_type=sa.Text()), type_=sa.JSON(), existing_nullable=False, postgresql_using='"details"::json', )