new_contents: # Generated by Django 2.2.13 on 2020-07-30 18:59
  
  from django.db import migrations
  from corehq.util.django_migrations import skip_on_fresh_install
  
  
  @skip_on_fresh_install
  def back_populate(apps, schema_editor):
      HqDeploy = apps.get_model('hqadmin', 'HqDeploy')
      for deploy in HqDeploy.objects.all():
          if not deploy.commit:
              deploy.commit = _get_commit_from_url(deploy.diff_url)
  
  
  def _get_commit_from_url(diff_url):
      try:
          ref_comparison = diff_url.split('/')[-1]
          last_deploy_sha, current_deploy_sha = ref_comparison.split('...')
          return current_deploy_sha
      except ValueError:
          # not a real diff_url
          return None
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('hqadmin', '0017_hqdeploy_commit'),
      ]
  
      operations = [
          migrations.RunPython(back_populate),
      ]
  
subject: Add migration that back populates the new commit field in the HqDeploy model