mirror of
https://github.com/peeringdb/peeringdb.git
synced 2024-05-11 05:55:09 +00:00
Gh 461 - Implement IX-F Import Toggle (#466)
This commit is contained in:
20
peeringdb_server/migrations/0017_ixf_ixp_import_enabled.py
Normal file
20
peeringdb_server/migrations/0017_ixf_ixp_import_enabled.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.15 on 2019-03-20 08:02
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('peeringdb_server', '0016_auto_20190110_2321'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='ixlan',
|
||||
name='ixf_ixp_import_enabled',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.15 on 2019-03-20 08:09
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
def forwards_func(apps, schema_editor):
|
||||
model = apps.get_model("peeringdb_server", "IXLan")
|
||||
for ixlan in model.objects.all():
|
||||
if ixlan.ixf_ixp_member_list_url:
|
||||
ixlan.ixf_ixp_import_enabled = True
|
||||
ixlan.save()
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('peeringdb_server', '0017_ixf_ixp_import_enabled'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelManagers(
|
||||
name='ixlan',
|
||||
managers=[],
|
||||
),
|
||||
migrations.RunPython(forwards_func, migrations.RunPython.noop),
|
||||
]
|
||||
Reference in New Issue
Block a user