# Generated by Django 2.0 on 2019-05-08 18:56

from django.db import migrations, models
import django.db.models.deletion

def forwards_func(apps, schema_editor):
    from tritium.apps.networks.models import MAIN_NETWORK
    Subscription = apps.get_model("subscriptions", "Subscription")
    db_alias = schema_editor.connection.alias
    Subscription.objects.using(db_alias).all().update(network=MAIN_NETWORK())

def reverse_func(apps, schema_editor):
    pass

class Migration(migrations.Migration):

    dependencies = [
        ('networks', '0002_scanner_locked_thread_time'),
        ('subscriptions', '0005_subscription_abi_methods'),
    ]

    operations = [
        migrations.AddField(
            model_name='subscription',
            name='network',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='networks.Network'),
        ),
        migrations.RunPython(forwards_func, reverse_func),
    ]
