new_contents: """Use new naming conventions for constraints
  
  Revision ID: 54cb4979543
  Revises: 40f1fd0d52
  Create Date: 2015-07-18 13:11:40.067173
  
  """
  
  # revision identifiers, used by Alembic.
  revision = '54cb4979543'
  down_revision = '40f1fd0d52'
  
  from alembic import op
  import sqlalchemy as sa
  
  
  def upgrade():
      ### commands auto generated by Alembic - please adjust! ###
      op.create_unique_constraint(op.f('uq_category_name'), 'category', ['name'])
      op.drop_index('name', table_name='category')
      op.create_unique_constraint(op.f('uq_challenge_name'), 'challenge', ['name'])
      op.drop_index('name', table_name='challenge')
      op.create_unique_constraint(op.f('uq_company_name'), 'company', ['name'])
      op.drop_index('name', table_name='company')
      op.create_unique_constraint(op.f('uq_contact_email'), 'contact', ['email'])
      op.drop_index('email', table_name='contact')
      op.create_unique_constraint(op.f('uq_file_name'), 'file', ['name'])
      op.drop_index('name', table_name='file')
      op.create_unique_constraint(op.f('uq_group_name'), 'group', ['name'])
      op.drop_index('name', table_name='group')
      op.create_unique_constraint(op.f('uq_page_path'), 'page', ['path'])
      op.drop_index('path', table_name='page')
      op.create_unique_constraint(op.f('uq_redirect_fro'), 'redirect', ['fro'])
      op.drop_index('fro', table_name='redirect')
      op.create_unique_constraint(op.f('uq_user_email'), 'user', ['email'])
      op.drop_index('email', table_name='user')
      op.create_unique_constraint(op.f('uq_vacancy_title'), 'vacancy', ['title'])
      op.drop_index('title', table_name='vacancy')
      ### end Alembic commands ###
  
  
  def downgrade():
      ### commands auto generated by Alembic - please adjust! ###
      op.create_index('title', 'vacancy', ['title'], unique=True)
      op.drop_constraint(op.f('uq_vacancy_title'), 'vacancy', type_='unique')
      op.create_index('email', 'user', ['email'], unique=True)
      op.drop_constraint(op.f('uq_user_email'), 'user', type_='unique')
      op.create_index('fro', 'redirect', ['fro'], unique=True)
      op.drop_constraint(op.f('uq_redirect_fro'), 'redirect', type_='unique')
      op.create_index('path', 'page', ['path'], unique=True)
      op.drop_constraint(op.f('uq_page_path'), 'page', type_='unique')
      op.create_index('name', 'group', ['name'], unique=True)
      op.drop_constraint(op.f('uq_group_name'), 'group', type_='unique')
      op.create_index('name', 'file', ['name'], unique=True)
      op.drop_constraint(op.f('uq_file_name'), 'file', type_='unique')
      op.create_index('email', 'contact', ['email'], unique=True)
      op.drop_constraint(op.f('uq_contact_email'), 'contact', type_='unique')
      op.create_index('name', 'company', ['name'], unique=True)
      op.drop_constraint(op.f('uq_company_name'), 'company', type_='unique')
      op.create_index('name', 'challenge', ['name'], unique=True)
      op.drop_constraint(op.f('uq_challenge_name'), 'challenge', type_='unique')
      op.create_index('name', 'category', ['name'], unique=True)
      op.drop_constraint(op.f('uq_category_name'), 'category', type_='unique')
      ### end Alembic commands ###
  
subject: Migrate db to use new naming conventions