original_docstring: 
      Upgrade the database to this revision
      
docstring: Upgrade the database to this revision
docstring_tokens: Upgrade the database to this revision
code: def upgrade():
      '''
      Upgrade the database to this revision
      '''
  
      schema = context.get_context().version_table_schema + '.' if context.get_context().version_table_schema else ''
  
      if context.get_context().dialect.name == 'oracle':
          try_drop_constraint('REPLICAS_STATE_CHK', 'replicas')
          create_check_constraint(constraint_name='REPLICAS_STATE_CHK', table_name='replicas',
                                  condition="state in ('A', 'U', 'C', 'B', 'D', 'S', 'T')")
  
      elif context.get_context().dialect.name == 'postgresql':
          op.execute('ALTER TABLE ' + schema + 'replicas DROP CONSTRAINT IF EXISTS "REPLICAS_STATE_CHK", ALTER COLUMN state TYPE CHAR')
          op.execute('DROP TYPE "REPLICAS_STATE_CHK"')
          op.execute("CREATE TYPE \"REPLICAS_STATE_CHK\" AS ENUM('A', 'U', 'C', 'B', 'D', 'S', 'T')")
          op.execute("ALTER TABLE %sreplicas ALTER COLUMN state TYPE \"REPLICAS_STATE_CHK\" USING state::\"REPLICAS_STATE_CHK\"" % schema)
  
      elif context.get_context().dialect.name == 'mysql':
          op.execute('ALTER TABLE ' + schema + 'replicas DROP CHECK REPLICAS_STATE_CHK')  # pylint: disable=no-member
          create_check_constraint(constraint_name='REPLICAS_STATE_CHK', table_name='replicas',
                                  condition="state in ('A', 'U', 'C', 'B', 'D', 'S', 'T')")
code_tokens: def upgrade ( ) : schema = context . get_context ( ) . version_table_schema + '.' if context . get_context ( ) . version_table_schema else '' if context . get_context ( ) . dialect . name == 'oracle' : try_drop_constraint ( 'REPLICAS_STATE_CHK' , 'replicas' ) create_check_constraint ( constraint_name = 'REPLICAS_STATE_CHK' , table_name = 'replicas' , condition = "state in ('A', 'U', 'C', 'B', 'D', 'S', 'T')" ) elif context . get_context ( ) . dialect . name == 'postgresql' : op . execute ( 'ALTER TABLE ' + schema + 'replicas DROP CONSTRAINT IF EXISTS "REPLICAS_STATE_CHK", ALTER COLUMN state TYPE CHAR' ) op . execute ( 'DROP TYPE "REPLICAS_STATE_CHK"' ) op . execute ( "CREATE TYPE \"REPLICAS_STATE_CHK\" AS ENUM('A', 'U', 'C', 'B', 'D', 'S', 'T')" ) op . execute ( "ALTER TABLE %sreplicas ALTER COLUMN state TYPE \"REPLICAS_STATE_CHK\" USING state::\"REPLICAS_STATE_CHK\"" % schema ) elif context . get_context ( ) . dialect . name == 'mysql' : op . execute ( 'ALTER TABLE ' + schema + 'replicas DROP CHECK REPLICAS_STATE_CHK' ) create_check_constraint ( constraint_name = 'REPLICAS_STATE_CHK' , table_name = 'replicas' , condition = "state in ('A', 'U', 'C', 'B', 'D', 'S', 'T')" )
short_docstring: Upgrade the database to this revision
short_docstring_tokens: Upgrade the database to this revision
comment: '''
      Upgrade the database to this revision
      '''$SEP$# pylint: disable=no-member