old_contents: # Generated by Django 2.2.10 on 2020-04-09 21:24
  
  from django.db import migrations
  from django.db.utils import IntegrityError
  
  
  def add_deferred_user_role(apps, schema_editor):
      DEFERRED_MENTOR = 'Deferred Mentor'
      UserRole = apps.get_model('accelerator', 'UserRole')
      Program = apps.get_model('accelerator', 'Program')
      ProgramRole = apps.get_model('accelerator', 'ProgramRole')
      user_role = UserRole.objects.create(
          name=DEFERRED_MENTOR, sort_order='17')
      for program in Program.objects.all():
          try:
              ProgramRole.objects.get_or_create(
                  program=program,
                  user_role=user_role)
          except IntegrityError:
              pass
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('accelerator', '0018_make_location_nonrequired'),
      ]
  
      operations = [
          migrations.RunPython(add_deferred_user_role,
                               migrations.RunPython.noop)
      ]
  
new_contents: # Generated by Django 2.2.10 on 2020-04-09 21:24
  
  from django.db import migrations
  from django.db.utils import IntegrityError
  
  
  def add_deferred_user_role(apps, schema_editor):
      DEFERRED_MENTOR = 'Deferred Mentor'
      UserRole = apps.get_model('accelerator', 'UserRole')
      Program = apps.get_model('accelerator', 'Program')
      ProgramRole = apps.get_model('accelerator', 'ProgramRole')
      user_role = UserRole.objects.create(
          name=DEFERRED_MENTOR, sort_order='17')
      for program in Program.objects.all():
          name="{} {} Deferred Mentor".format(
              program.start_date.year, 
              program.program_family.name)
          program = ProgramRole.objects.get_or_create(
              program=program,
              user_role=user_role,
              defaults={'name': name})
          return program
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('accelerator', '0018_make_location_nonrequired'),
      ]
  
      operations = [
          migrations.RunPython(add_deferred_user_role,
                               migrations.RunPython.noop)
      ]
  
subject: Remove Integrity erro check