"""make routings contain error

Revision ID: 8c74e7df26f8
Revises: 85615e005fa3
Create Date: 2023-10-01 15:05:38.743702

"""

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

# revision identifiers, used by Alembic.
revision = "8c74e7df26f8"
down_revision = "85615e005fa3"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "routings", sa.Column("error_data", postgresql.JSONB(astext_type=sa.Text()), nullable=True)
    )
    op.alter_column("routings", "session", existing_type=postgresql.UUID(), nullable=True)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column("routings", "session", existing_type=postgresql.UUID(), nullable=False)
    op.drop_column("routings", "error_data")
    # ### end Alembic commands ###
