text: # Generated by Django 3.2.3 on 2021-05-24 09:24
  
  from django.db import migrations
  import logging
  
  logger = logging.getLogger(__name__)
  
  
  def remove_data_from_model(model, apps):
      try:
          model = apps.get_model("assessment", model)
          # if model exists, delete all instances from DB
          model.objects.all().delete()
      except LookupError:
          # model does not exist; do nothing
          pass
  
  
  def remove_sample_data(apps, schema_editor):
      models_to_delete_from = ["answer", "question",
                               "choice", "pathway", "pathwaygroup"]
      for model in models_to_delete_from:
          remove_data_from_model(model, apps)
  
  
  class Migration(migrations.Migration):
      dependencies = [
          ('assessment', '0009_auto_20210513_1301'),
      ]
  
      operations = [
          migrations.RunPython(remove_sample_data),
      ]
  