text: """
  Move to BIGINT columns for Discord ids.
  
  Revision ID: 76bffa9d07db
  Revises: 7efb7499ead4
  Create Date: 2021-11-08 20:24:15.991366
  """
  import sqlalchemy as sa
  import sqlmodel  # noqa: F401
  from alembic import op
  
  #  Revision identifiers, used by Alembic.
  revision = '76bffa9d07db'
  down_revision = '7efb7499ead4'
  branch_labels = None
  depends_on = None
  
  
  def upgrade():
      """Upgrade the connected DB to this revision."""
      # ### commands auto generated by Alembic - please adjust! ###
      op.drop_index('ix_help_sessions_claimant_id', table_name='help_sessions')
      op.drop_index('ix_messages_author_id', table_name='messages')
      op.drop_index('ix_messages_message_id', table_name='messages')
      op.drop_index('ix_messages_session_id', table_name='messages')
      op.drop_index('ix_users_user_id', table_name='users')
      op.alter_column(
          'help_sessions',
          'claimant_id',
          existing_type=sa.INTEGER(),
          type_=sa.BigInteger(),
          existing_nullable=False
      )
      op.alter_column(
          'help_sessions',
          'channel_id',
          existing_type=sa.INTEGER(),
          type_=sa.BigInteger(),
          existing_nullable=False
      )
      op.alter_column(
          'messages',
          'message_id',
          existing_type=sa.INTEGER(),
          type_=sa.BigInteger(),
          existing_nullable=False,
          autoincrement=True
      )
      op.alter_column(
          'messages',
          'author_id',
          existing_type=sa.INTEGER(),
          type_=sa.BigInteger(),
          existing_nullable=False
      )
      op.alter_column(
          'messages',
          'session_id',
          existing_type=sa.INTEGER(),
          type_=sa.BigInteger(),
          existing_nullable=False
      )
      op.alter_column(
          'users',
          'user_id',
          existing_type=sa.INTEGER(),
          type_=sa.BigInteger(),
          existing_nullable=False,
          autoincrement=True,
          existing_server_default=sa.text("nextval('users_user_id_seq'::regclass)")
      )
      # ### end Alembic commands ###
  
  
  def downgrade():
      """Downgrade the connected DB to the previous revision."""
      # ### commands auto generated by Alembic - please adjust! ###
      op.create_index('ix_users_user_id', 'users', ['user_id'], unique=False)
      op.create_index('ix_messages_session_id', 'messages', ['session_id'], unique=False)
      op.create_index('ix_messages_message_id', 'messages', ['message_id'], unique=False)
      op.create_index('ix_messages_author_id', 'messages', ['author_id'], unique=False)
      op.create_index('ix_help_sessions_claimant_id', 'help_sessions', ['claimant_id'], unique=False)
      op.alter_column(
          'users',
          'user_id',
          existing_type=sa.BigInteger(),
          type_=sa.INTEGER(),
          existing_nullable=False,
          autoincrement=True,
          existing_server_default=sa.text("nextval('users_user_id_seq'::regclass)")
      )
      op.alter_column(
          'messages',
          'session_id',
          existing_type=sa.BigInteger(),
          type_=sa.INTEGER(),
          existing_nullable=False
      )
      op.alter_column(
          'messages',
          'author_id',
          existing_type=sa.BigInteger(),
          type_=sa.INTEGER(),
          existing_nullable=False
      )
      op.alter_column(
          'messages',
          'message_id',
          existing_type=sa.BigInteger(),
          type_=sa.INTEGER(),
          existing_nullable=False,
          autoincrement=True
      )
      op.alter_column(
          'help_sessions',
          'channel_id',
          existing_type=sa.BigInteger(),
          type_=sa.INTEGER(),
          existing_nullable=False
      )
      op.alter_column(
          'help_sessions',
          'claimant_id',
          existing_type=sa.BigInteger(),
          type_=sa.INTEGER(),
          existing_nullable=False
      )
      # ### end Alembic commands ###
  