aboutsummaryrefslogtreecommitdiffstats
path: root/src/resource_inventory/migrations/0012_auto_20200103_1850.py
diff options
context:
space:
mode:
authorGergely Csatari <gergely.csatari@nokia.com>2023-10-26 10:33:28 +0300
committerGergely Csatari <gergely.csatari@nokia.com>2023-10-26 10:34:28 +0300
commit2ec0d7b9f5c1354977b821c6b06c24a3ffa13142 (patch)
tree6e449d92ddfc880ed007e9d8a8f25bda8fc7cb0f /src/resource_inventory/migrations/0012_auto_20200103_1850.py
parent0d3dd290aa6e7f39e7b0b3cbe448b6622f924240 (diff)
Removing project content and adding a noteHEADmaster
that the development continues in GitHub Change-Id: I25c58a679dbf92b2367d826429b7cda936bf9f0e Signed-off-by: Gergely Csatari <gergely.csatari@nokia.com>
Diffstat (limited to 'src/resource_inventory/migrations/0012_auto_20200103_1850.py')
-rw-r--r--src/resource_inventory/migrations/0012_auto_20200103_1850.py59
1 files changed, 0 insertions, 59 deletions
diff --git a/src/resource_inventory/migrations/0012_auto_20200103_1850.py b/src/resource_inventory/migrations/0012_auto_20200103_1850.py
deleted file mode 100644
index 65d8f85..0000000
--- a/src/resource_inventory/migrations/0012_auto_20200103_1850.py
+++ /dev/null
@@ -1,59 +0,0 @@
-# Generated by Django 2.2 on 2020-01-03 18:50
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-def pairVlanPhysicalNetworks(apps, editor):
- PhysicalNetwork = apps.get_model("resource_inventory", "PhysicalNetwork")
- Vlan = apps.get_model("resource_inventory", "Vlan")
- for vlan in Vlan.objects.filter(network__isnull=False):
- if PhysicalNetwork.objects.filter(id=vlan.network.id).exists():
- continue
- PhysicalNetwork.objects.create(id=vlan.network.id, vlan_id=vlan.vlan_id, generic_network=vlan.network)
-
-
-def deletePhysicalNetworks(apps, editor):
- Vlan = apps.get_model("resource_inventory", "Vlan")
- for vlan in Vlan.objects.all():
- vlan.network = None
- PhysicalNetwork = apps.get_model("resource_inventory", "PhysicalNetwork")
- PhysicalNetwork.objects.all().delete()
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('resource_inventory', '0011_auto_20191106_2024'),
- ]
-
- operations = [
- migrations.CreateModel(
- name='PhysicalNetwork',
- fields=[
- ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('vlan_id', models.IntegerField()),
- ('generic_network', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='resource_inventory.Network')),
- ],
- options={
- 'abstract': False,
- },
- ),
- migrations.AlterField(
- model_name='host',
- name='id',
- field=models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
- ),
- migrations.AlterField(
- model_name='resourcebundle',
- name='id',
- field=models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
- ),
- migrations.RunPython(pairVlanPhysicalNetworks, deletePhysicalNetworks),
- migrations.AlterField(
- model_name='vlan',
- name='network',
- field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING,
- to='resource_inventory.PhysicalNetwork', null=True),
- ),
- ]