@@ -0,0 +1,731 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0Afrom django.apps import apps%0A%0Adef populate_subscriptions(apps):%0A    print(%22entering populate_subscriptions%22)%0A    Certificates = apps.get_model(%22monitors%22,%22CertificateMonitor%22)%0A    Subscription = apps.get_model(%22monitors%22,%22CertificateSubscription%22)%0A    for certificate in Certificates.objects.all():%0A       NewSubscription = Subscription(certificate=certificate,owner= certificate.owner)%0A       NewSubscription.save()%0A%0A%0Aclass Migration(migrations.Migration):%0A    dependencies = %5B%0A        ('monitors', '0003_certificatesubscription'),%0A    %5D%0A%0A    operations = %5B%0A        migrations.RunPython(populate_subscriptions(apps)),%0A    %5D%0A

Add script to migrate data to certificatesubscription table