old_contents: # Generated by Django 2.2.1 on 2019-05-13 22:19
  
  from django.db import migrations
  
  
  def move_liner_perforations(apps, schema_editor):
      LinerPerforation = apps.get_model('wells', 'LinerPerforation')
      ActivitySubmissionLinerPerforation = apps.get_model('wells', 'ActivitySubmissionLinerPerforation')
      ActivitySubmission = apps.get_model('wells', 'ActivitySubmission')
  
      for perforation in LinerPerforation.objects.filter(activity_submission__isnull=False):
          # Create a new perforatin object.
          ActivitySubmissionLinerPerforation.objects.create(
              activity_submission=ActivitySubmission.objects.get(filing_number=perforation.activity_submission),
              create_user=perforation.create_user,
              update_user=perforation.update_user,
              create_date=perforation.create_date,
              update_date=perforation.update_date,
              start=perforation.start,
              end=perforation.end)
      LinerPerforation.objects.filter(activity_submission__isnull=False).delete()
  
  
  def reverse_liner_perforations(apps, schema_editor):
      LinerPerforation = apps.get_model('wells', 'LinerPerforation')
      ActivitySubmissionLinerPerforation = apps.get_model('wells', 'ActivitySubmissionLinerPerforation')
  
      for perforation in ActivitySubmissionLinerPerforation.objects.all():
          LinerPerforation.objects.create(
              activity_submission=perforation.activity_submission.filing_number,
              create_user=perforation.create_user,
              update_user=perforation.update_user,
              create_date=perforation.create_date,
              update_date=perforation.update_date,
              start=perforation.start,
              end=perforation.end
          )
      ActivitySubmissionLinerPerforation.objects.all().delete()
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('wells', '0083_merge_20190510_2215'),
      ]
  
      operations = [
          migrations.RunPython(move_liner_perforations, reverse_liner_perforations),
      ]
  
new_contents: # Generated by Django 2.2.1 on 2019-05-13 22:19
  
  from django.db import migrations
  
  
  def move_liner_perforations(apps, schema_editor):
      LinerPerforation = apps.get_model('wells', 'LinerPerforation')
      ActivitySubmissionLinerPerforation = apps.get_model('wells', 'ActivitySubmissionLinerPerforation')
      ActivitySubmission = apps.get_model('wells', 'ActivitySubmission')
  
      for perforation in LinerPerforation.objects.filter(activity_submission__isnull=False):
          # Create a new perforation object.
          ActivitySubmissionLinerPerforation.objects.create(
              activity_submission=ActivitySubmission.objects.get(filing_number=perforation.activity_submission),
              create_user=perforation.create_user,
              update_user=perforation.update_user,
              create_date=perforation.create_date,
              update_date=perforation.update_date,
              start=perforation.start,
              end=perforation.end)
      LinerPerforation.objects.filter(activity_submission__isnull=False).delete()
  
  
  def reverse_liner_perforations(apps, schema_editor):
      LinerPerforation = apps.get_model('wells', 'LinerPerforation')
      ActivitySubmissionLinerPerforation = apps.get_model('wells', 'ActivitySubmissionLinerPerforation')
  
      for perforation in ActivitySubmissionLinerPerforation.objects.all():
          LinerPerforation.objects.create(
              activity_submission=perforation.activity_submission.filing_number,
              create_user=perforation.create_user,
              update_user=perforation.update_user,
              create_date=perforation.create_date,
              update_date=perforation.update_date,
              start=perforation.start,
              end=perforation.end
          )
      ActivitySubmissionLinerPerforation.objects.all().delete()
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('wells', '0083_merge_20190510_2215'),
      ]
  
      operations = [
          migrations.RunPython(move_liner_perforations, reverse_liner_perforations),
      ]
  
subject: Update app/backend/wells/migrations/0084_move_liner_perforations.py