@@ -0,0 +1,1863 @@
+from django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A    dependencies = %5B%0A        ('models', '6014_bidirectional_resource_instance'),%0A    %5D%0A%0A    def forward_migrate(apps, schema_editor, with_create_permissions=True):%0A        nodes = apps.get_model(%22models%22, %22Node%22)%0A        datatypes = apps.get_model(%22models%22, %22DDataType%22)%0A        for datatype in datatypes.objects.filter(datatype__in=%5B%22resource-instance%22,%22resource-instance-list%22%5D):%0A            datatype.defaultconfig = %7B%22graphs%22: %5B%5D%7D%0A            datatype.save()%0A%0A        for node in nodes.objects.filter(datatype__in=%5B%22resource-instance%22,%22resource-instance-list%22%5D):%0A            old_config = node.config %0A            new_config = %7B%22graphs%22: %5B%5D%7D%0A            for graphid in old_config%5B%22graphid%22%5D:%0A                new_config%5B%22graphs%22%5D.append(%7B%0A                    %22graphid%22: graphid,%0A                    %22ontologyProperty%22: %22%22,%0A                    %22inverseOntolgoyProperty%22: %22%22%0A                %7D)%0A            node.config = new_config%0A            node.save()%0A%0A%0A    def reverse_migrate(apps, schema_editor, with_create_permissions=True):%0A        nodes = apps.get_model(%22models%22, %22Node%22)%0A        datatypes = apps.get_model(%22models%22, %22DDataType%22)%0A        for datatype in datatypes.objects.filter(datatype__in=%5B%22resource-instance%22,%22resource-instance-list%22%5D):%0A            datatype.defaultconfig = %7B%22graphid%22: None%7D%0A            datatype.save()%0A%0A        for node in nodes.objects.filter(datatype__in=%5B%22resource-instance%22,%22resource-instance-list%22%5D):%0A            new_config = node.config %0A            old_config = %7B%22graphid%22: %5B%5D%7D%0A            for config in new_config%5B%22graphs%22%5D:%0A                old_config%5B%22graphid%22%5D.append(config%5B%22graphid%22%5D)%0A            node.config = old_config%0A            node.save()%0A%0A%0A    operations = %5B%0A        migrations.RunPython(forward_migrate, reverse_migrate),%0A    %5D%0A

add migration for node config for resource instance datatype, re #6019