
from django.db import migrations


def resave_packets(apps, schema_editor):
    '''
    Re-save all existing packets to update their URLs based on the
    new value of MERGE_HOST.
    '''
    for packet in ('BillPacket', 'EventPacket'):
        packet_model = apps.get_model('lametro', packet)
        for p in packet_model.objects.all():
            p.save(merge=False)


class Migration(migrations.Migration):

    dependencies = [
        ('lametro', '0006_add_plan_program_policy'),
    ]

    operations = [
        migrations.RunPython(resave_packets),
    ]


from django.db import migrations


def resave_packets(apps, schema_editor):
    '''
    Re-save all existing packets to update their URLs based on the
    new value of MERGE_HOST.
    '''
#    for packet in ('BillPacket', 'EventPacket'):
#        packet_model = apps.get_model('lametro', packet)
#        for p in packet_model.objects.all():
#            p.save(merge=False)
    return


class Migration(migrations.Migration):

    dependencies = [
        ('lametro', '0006_add_plan_program_policy'),
    ]

    operations = [
        migrations.RunPython(resave_packets),
    ]

Disable data migration for deployment
Disable data migration for deployment

  
  from django.db import migrations
  
  
  def resave_packets(apps, schema_editor):
      '''
      Re-save all existing packets to update their URLs based on the
      new value of MERGE_HOST.
      '''
-     for packet in ('BillPacket', 'EventPacket'):
+ #    for packet in ('BillPacket', 'EventPacket'):
-         packet_model = apps.get_model('lametro', packet)
+ #        packet_model = apps.get_model('lametro', packet)
-         for p in packet_model.objects.all():
+ #        for p in packet_model.objects.all():
-             p.save(merge=False)
+ #            p.save(merge=False)
+     return
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('lametro', '0006_add_plan_program_policy'),
      ]
  
      operations = [
          migrations.RunPython(resave_packets),
      ]
  
Disable data migration for deployment
## Code Before:

from django.db import migrations


def resave_packets(apps, schema_editor):
    '''
    Re-save all existing packets to update their URLs based on the
    new value of MERGE_HOST.
    '''
    for packet in ('BillPacket', 'EventPacket'):
        packet_model = apps.get_model('lametro', packet)
        for p in packet_model.objects.all():
            p.save(merge=False)


class Migration(migrations.Migration):

    dependencies = [
        ('lametro', '0006_add_plan_program_policy'),
    ]

    operations = [
        migrations.RunPython(resave_packets),
    ]

## Instruction:
Disable data migration for deployment
## Code After:

from django.db import migrations


def resave_packets(apps, schema_editor):
    '''
    Re-save all existing packets to update their URLs based on the
    new value of MERGE_HOST.
    '''
#    for packet in ('BillPacket', 'EventPacket'):
#        packet_model = apps.get_model('lametro', packet)
#        for p in packet_model.objects.all():
#            p.save(merge=False)
    return


class Migration(migrations.Migration):

    dependencies = [
        ('lametro', '0006_add_plan_program_policy'),
    ]

    operations = [
        migrations.RunPython(resave_packets),
    ]
