"""convert billing audit log event_data from json to jsonb

Revision ID: 96997c4da432
Revises: f599c98cf98c
Create Date: 2026-03-09 12:37:21.640098

"""

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

# revision identifiers, used by Alembic.
revision = "96997c4da432"
down_revision = "f599c98cf98c"
branch_labels = None
depends_on = None


def upgrade() -> None:
  # ### commands auto generated by Alembic - please adjust! ###
  op.alter_column(
    "billing_audit_logs",
    "event_data",
    existing_type=postgresql.JSON(astext_type=sa.Text()),
    type_=postgresql.JSONB(astext_type=sa.Text()),
    existing_nullable=True,
  )
  # ### end Alembic commands ###


def downgrade() -> None:
  # ### commands auto generated by Alembic - please adjust! ###
  op.alter_column(
    "billing_audit_logs",
    "event_data",
    existing_type=postgresql.JSONB(astext_type=sa.Text()),
    type_=postgresql.JSON(astext_type=sa.Text()),
    existing_nullable=True,
  )
  # ### end Alembic commands ###
