378bdc3244fc4f189916b8fe74524a598e432e48
[laas.git] / src / resource_inventory / migrations / 0012_manual_20200218_1536.py
1 # Generated by Django 2.2 on 2020-02-18 15:36
2
3 from django.conf import settings
4 from django.db import migrations
5
6
7 def clear_networks(apps, schema_editor):
8     Network = apps.get_model('resource_inventory', 'Network')
9     Vlan = apps.get_model('resource_inventory', 'Vlan')
10     for vlan in Vlan.objects.all():
11         vlan.delete()
12     for net in Network.objects.all():
13         net.delete()
14
15
16 class Migration(migrations.Migration):
17
18     dependencies = [
19         migrations.swappable_dependency(settings.AUTH_USER_MODEL),
20         ('resource_inventory', '0012_auto_20200103_1850'),
21     ]
22
23     operations = [
24         migrations.RunPython(clear_networks)
25     ]