text: """Switch to pure SQLAlchemy
  
  Revision ID: a2545f11cbf8
  Revises: b5900a4c68b4
  Create Date: 2021-03-23 06:51:26.806423+00:00
  
  """
  from alembic import op
  import sqlalchemy as sa
  from sqlalchemy.dialects import postgresql
  
  # revision identifiers, used by Alembic.
  revision = "a2545f11cbf8"
  down_revision = "b5900a4c68b4"
  branch_labels = None
  depends_on = None
  
  
  def upgrade():
      # ### commands auto generated by Alembic - please adjust! ###
      op.alter_column(
          "canned_responses",
          "fields",
          existing_type=sa.TEXT(),
          type_=postgresql.JSON(astext_type=sa.Text()),
          existing_nullable=False,
          postgresql_using="fields::json",
      )
      op.alter_column(
          "messages",
          "sender_id",
          existing_type=sa.INTEGER(),
          type_=sa.BigInteger(),
          existing_nullable=False,
      )
      op.alter_column(
          "tickets",
          "creator_id",
          existing_type=sa.INTEGER(),
          type_=sa.BigInteger(),
          existing_nullable=False,
      )
      op.alter_column(
          "users",
          "id",
          existing_type=sa.INTEGER(),
          type_=sa.BigInteger(),
          existing_nullable=False,
          autoincrement=True,
          existing_server_default=sa.text("nextval('users_id_seq'::regclass)"),
      )
      # ### end Alembic commands ###
  
  
  def downgrade():
      # ### commands auto generated by Alembic - please adjust! ###
      op.alter_column(
          "users",
          "id",
          existing_type=sa.BigInteger(),
          type_=sa.INTEGER(),
          existing_nullable=False,
          autoincrement=True,
          existing_server_default=sa.text("nextval('users_id_seq'::regclass)"),
      )
      op.alter_column(
          "tickets",
          "creator_id",
          existing_type=sa.BigInteger(),
          type_=sa.INTEGER(),
          existing_nullable=False,
      )
      op.alter_column(
          "messages",
          "sender_id",
          existing_type=sa.BigInteger(),
          type_=sa.INTEGER(),
          existing_nullable=False,
      )
      op.alter_column(
          "canned_responses",
          "fields",
          existing_type=postgresql.JSON(astext_type=sa.Text()),
          type_=sa.TEXT(),
          existing_nullable=False,
      )
      # ### end Alembic commands ###
  