new_contents: # Generated by Django 2.2.24 on 2021-06-29 13:16
  
  from django.db import migrations
  from django.db.models import Min
  
  from corehq.util.django_migrations import skip_on_fresh_install
  
  
  def _reset_date_modified(model_name):
      @skip_on_fresh_install
      def _reset_date(apps, schema_editor):
          model = apps.get_model('sms', model_name)
          min_date = model.objects.aggregate(min_date=Min("date_modified"))['min_date']
          if min_date:
              model.objects.filter(date_modified=min_date).update(date_modified=None)
  
      return _reset_date
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('sms', '0050_sms_email_date_modified'),
      ]
  
      operations = [
          migrations.RunPython(_reset_date_modified('SMS'), migrations.RunPython.noop),
          migrations.RunPython(_reset_date_modified('Email'), migrations.RunPython.noop),
      ]
  
subject: reset date modified for legacy sms and email data