aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/migrations/0012_manual_20200218_1536.py
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2020-03-16 17:54:09 +0000
committerGerrit Code Review <gerrit@opnfv.org>2020-03-16 17:54:09 +0000
commit0db3a84d9d9ed213983a517efd35c339537ef472 (patch)
treea6d7ac7ba2f2d70e18cb984bda4020c736082c62 /src/api/migrations/0012_manual_20200218_1536.py
parent176ec9aacbc87e6077e8807c60f95a1ccbbc26e3 (diff)
parent064f145f218385a6401fa6be2ccbbc462e915c26 (diff)
Merge "Test resource templates now use the same lab as the image generated alongside it."
Diffstat (limited to 'src/api/migrations/0012_manual_20200218_1536.py')
-rw-r--r--src/api/migrations/0012_manual_20200218_1536.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/api/migrations/0012_manual_20200218_1536.py b/src/api/migrations/0012_manual_20200218_1536.py
new file mode 100644
index 0000000..55befbd
--- /dev/null
+++ b/src/api/migrations/0012_manual_20200218_1536.py
@@ -0,0 +1,22 @@
+# Generated by Django 2.2 on 2020-02-18 15:36
+
+from django.db import migrations
+
+
+def set_resource_id(apps, schema_editor):
+ for cls in ["HostHardwareRelation", "HostNetworkRelation", "SnapshotConfig"]:
+ model = apps.get_model('api', cls)
+ for m in model.objects.all():
+ m.resource_id = m.host.labid
+ m.save()
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('api', '0011_auto_20200218_1536'),
+ ]
+
+ operations = [
+ migrations.RunPython(set_resource_id),
+ ]