aboutsummaryrefslogtreecommitdiffstats
path: root/src/resource_inventory/migrations/0012_manual_20200218_1536.py
blob: 378bdc3244fc4f189916b8fe74524a598e432e48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Generated by Django 2.2 on 2020-02-18 15:36

from django.conf import settings
from django.db import migrations


def clear_networks(apps, schema_editor):
    Network = apps.get_model('resource_inventory', 'Network')
    Vlan = apps.get_model('resource_inventory', 'Vlan')
    for vlan in Vlan.objects.all():
        vlan.delete()
    for net in Network.objects.all():
        net.delete()


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('resource_inventory', '0012_auto_20200103_1850'),
    ]

    operations = [
        migrations.RunPython(clear_networks)
    ]