18 changed files with 0 additions and 1114 deletions
-
302abonapp/migrations/0001_initial.py
-
155abonapp/migrations/0002_auto_20180808_1448.py
-
22abonapp/migrations/0003_abon_nas.py
-
44abonapp/migrations/0004_auto_20180918_1734.py
-
19abonapp/migrations/0005_current_tariff.py
-
51abonapp/migrations/0006_change_ip.py
-
23abonapp/migrations/0007_auto_20181101_1545.py
-
34abonapp/migrations/0008_auto_20181115_1206.py
-
69devapp/migrations/0001_initial.py
-
26devapp/migrations/0002_auto_20180409_1318.py
-
60devapp/migrations/0003_auto_20180529_1311.py
-
21devapp/migrations/0004_device_extra_data.py
-
44devapp/migrations/0005_device_ip_address_change.py
-
65ip_pool/migrations/0001_initial.py
-
23ip_pool/migrations/0002_change_unique.py
-
50ip_pool/migrations/0003_auto_20181019_1230.py
-
15ip_pool/migrations/0004_auto_20190305_1243.py
-
91ip_pool/models.py
@ -1,302 +0,0 @@ |
|||||
# -*- coding: utf-8 -*- |
|
||||
# Generated by Django 1.11 on 2018-02-26 00:20 |
|
||||
from __future__ import unicode_literals |
|
||||
|
|
||||
import bitfield.models |
|
||||
from django.conf import settings |
|
||||
import django.core.validators |
|
||||
from django.db import migrations, models |
|
||||
import django.db.models.deletion |
|
||||
from djing.fields import MyGenericIPAddressField |
|
||||
import re |
|
||||
|
|
||||
|
|
||||
class Migration(migrations.Migration): |
|
||||
initial = True |
|
||||
|
|
||||
dependencies = [ |
|
||||
('devapp', '0001_initial'), |
|
||||
('group_app', '0001_initial'), |
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), |
|
||||
('accounts_app', '0001_initial'), |
|
||||
('tariff_app', '0001_initial'), |
|
||||
] |
|
||||
|
|
||||
operations = [ |
|
||||
migrations.CreateModel( |
|
||||
name='Abon', |
|
||||
fields=[ |
|
||||
('baseaccount_ptr', |
|
||||
models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, |
|
||||
primary_key=True, serialize=False, to='accounts_app.BaseAccount')), |
|
||||
('ballance', models.FloatField(default=0.0)), |
|
||||
('ip_address', MyGenericIPAddressField(blank=True, max_length=8, null=True, protocol='ipv4')), |
|
||||
('description', models.TextField(blank=True, null=True, verbose_name='Comment')), |
|
||||
('house', models.CharField(blank=True, max_length=12, null=True, verbose_name='House')), |
|
||||
('is_dynamic_ip', models.BooleanField(default=False)), |
|
||||
('markers', bitfield.models.BitField((('icon_donkey', 'Donkey'), ('icon_fire', 'Fire'), |
|
||||
('icon_ok', 'Ok'), ('icon_king', 'King'), ('icon_tv', 'TV'), |
|
||||
('icon_smile', 'Smile'), ('icon_dollar', 'Dollar'), |
|
||||
('icon_service', 'Service'), ('icon_mrk', 'Marker')), default=0)), |
|
||||
], |
|
||||
options={ |
|
||||
'verbose_name': 'Abon', |
|
||||
'verbose_name_plural': 'Abons', |
|
||||
'db_table': 'abonent', |
|
||||
'ordering': ['fio'], |
|
||||
'permissions': (('can_buy_tariff', 'Buy service perm'), ('can_view_passport', 'Can view passport'), |
|
||||
('can_add_ballance', 'fill account'), ('can_ping', 'Can ping')), |
|
||||
}, |
|
||||
bases=('accounts_app.baseaccount',), |
|
||||
), |
|
||||
migrations.CreateModel( |
|
||||
name='AbonLog', |
|
||||
fields=[ |
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
|
||||
('amount', models.FloatField(default=0.0)), |
|
||||
('comment', models.CharField(max_length=128)), |
|
||||
('date', models.DateTimeField(auto_now_add=True)), |
|
||||
], |
|
||||
options={ |
|
||||
'db_table': 'abonent_log', |
|
||||
'ordering': ['-date'], |
|
||||
'permissions': (('can_view_abonlog', 'Can view subscriber logs'),), |
|
||||
}, |
|
||||
), |
|
||||
migrations.CreateModel( |
|
||||
name='AbonStreet', |
|
||||
fields=[ |
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
|
||||
('name', models.CharField(max_length=64)), |
|
||||
('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='group_app.Group')), |
|
||||
], |
|
||||
options={ |
|
||||
'verbose_name': 'Street', |
|
||||
'verbose_name_plural': 'Streets', |
|
||||
'db_table': 'abon_street', |
|
||||
'ordering': ['name'], |
|
||||
}, |
|
||||
), |
|
||||
migrations.CreateModel( |
|
||||
name='AbonTariff', |
|
||||
fields=[ |
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
|
||||
('time_start', models.DateTimeField(blank=True, default=None, null=True)), |
|
||||
('deadline', models.DateTimeField(blank=True, default=None, null=True)), |
|
||||
('tariff', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='linkto_tariff', |
|
||||
to='tariff_app.Tariff')), |
|
||||
], |
|
||||
options={ |
|
||||
'verbose_name': 'Abon service', |
|
||||
'verbose_name_plural': 'Abon services', |
|
||||
'db_table': 'abonent_tariff', |
|
||||
'ordering': ['time_start'], |
|
||||
'permissions': (('can_complete_service', 'finish service perm'),), |
|
||||
}, |
|
||||
), |
|
||||
migrations.CreateModel( |
|
||||
name='AdditionalTelephone', |
|
||||
fields=[ |
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
|
||||
('telephone', models.CharField(max_length=16, validators=[ |
|
||||
django.core.validators.RegexValidator('^\\+[7,8,9,3]\\d{10,11}$')], verbose_name='Telephone')), |
|
||||
('owner_name', models.CharField(max_length=127)), |
|
||||
], |
|
||||
options={ |
|
||||
'verbose_name': 'Additional telephone', |
|
||||
'verbose_name_plural': 'Additional telephones', |
|
||||
'db_table': 'additional_telephones', |
|
||||
'ordering': ('owner_name',), |
|
||||
'permissions': (('can_view_additionaltelephones', 'Can view additional telephones'),), |
|
||||
}, |
|
||||
), |
|
||||
migrations.CreateModel( |
|
||||
name='AllPayLog', |
|
||||
fields=[ |
|
||||
('pay_id', models.CharField(max_length=64, primary_key=True, serialize=False)), |
|
||||
('date_action', models.DateTimeField(auto_now_add=True)), |
|
||||
('summ', models.FloatField(default=0.0)), |
|
||||
('pay_system_name', models.CharField(max_length=16)), |
|
||||
], |
|
||||
options={ |
|
||||
'db_table': 'all_pay_log', |
|
||||
'ordering': ['-date_action'], |
|
||||
}, |
|
||||
), |
|
||||
migrations.CreateModel( |
|
||||
name='AllTimePayLog', |
|
||||
fields=[ |
|
||||
('pay_id', models.CharField(max_length=36, primary_key=True, serialize=False, unique=True)), |
|
||||
('date_add', models.DateTimeField(auto_now_add=True)), |
|
||||
('summ', models.FloatField(default=0.0)), |
|
||||
('trade_point', |
|
||||
models.CharField(blank=True, default=None, max_length=20, null=True, verbose_name='Trade point')), |
|
||||
('receipt_num', models.BigIntegerField(default=0, verbose_name='Receipt number')), |
|
||||
], |
|
||||
options={ |
|
||||
'db_table': 'all_time_pay_log', |
|
||||
'ordering': ['-date_add'], |
|
||||
}, |
|
||||
), |
|
||||
migrations.CreateModel( |
|
||||
name='ExtraFieldsModel', |
|
||||
fields=[ |
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
|
||||
('title', models.CharField(default='no title', max_length=16)), |
|
||||
('field_type', models.CharField( |
|
||||
choices=[('int', 'Digital field'), ('str', 'Text field'), ('dbl', 'Floating field'), |
|
||||
('ipa', 'Ip Address')], default='str', max_length=3)), |
|
||||
('data', models.CharField(blank=True, max_length=64, null=True)), |
|
||||
], |
|
||||
options={ |
|
||||
'db_table': 'abon_extra_fields', |
|
||||
}, |
|
||||
), |
|
||||
migrations.CreateModel( |
|
||||
name='InvoiceForPayment', |
|
||||
fields=[ |
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
|
||||
('status', models.BooleanField(default=False)), |
|
||||
('amount', models.FloatField(default=0.0)), |
|
||||
('comment', models.CharField(max_length=128)), |
|
||||
('date_create', models.DateTimeField(auto_now_add=True)), |
|
||||
('date_pay', models.DateTimeField(blank=True, null=True)), |
|
||||
], |
|
||||
options={ |
|
||||
'verbose_name': 'Debt', |
|
||||
'verbose_name_plural': 'Debts', |
|
||||
'db_table': 'abonent_inv_pay', |
|
||||
'ordering': ('date_create',), |
|
||||
'permissions': (('can_view_invoiceforpayment', 'Can view invoice for payment'),), |
|
||||
}, |
|
||||
), |
|
||||
migrations.CreateModel( |
|
||||
name='PassportInfo', |
|
||||
fields=[ |
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
|
||||
('series', models.CharField(max_length=4, validators=[ |
|
||||
django.core.validators.RegexValidator(re.compile('^-?\\d+\\Z', 32), code='invalid', |
|
||||
message='Enter a valid integer.')])), |
|
||||
('number', models.CharField(max_length=6, validators=[ |
|
||||
django.core.validators.RegexValidator(re.compile('^-?\\d+\\Z', 32), code='invalid', |
|
||||
message='Enter a valid integer.')])), |
|
||||
('distributor', models.CharField(max_length=64)), |
|
||||
('date_of_acceptance', models.DateField()), |
|
||||
], |
|
||||
options={ |
|
||||
'verbose_name': 'Passport Info', |
|
||||
'verbose_name_plural': 'Passport Info', |
|
||||
'db_table': 'passport_info', |
|
||||
}, |
|
||||
), |
|
||||
migrations.CreateModel( |
|
||||
name='PeriodicPayForId', |
|
||||
fields=[ |
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
|
||||
('last_pay', models.DateTimeField(blank=True, null=True, verbose_name='Last pay time')), |
|
||||
('next_pay', models.DateTimeField(verbose_name='Next time to pay')), |
|
||||
], |
|
||||
options={ |
|
||||
'db_table': 'periodic_pay_for_id', |
|
||||
}, |
|
||||
), |
|
||||
migrations.CreateModel( |
|
||||
name='AbonRawPassword', |
|
||||
fields=[ |
|
||||
('account', |
|
||||
models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, |
|
||||
to='abonapp.Abon')), |
|
||||
('passw_text', models.CharField(max_length=64)), |
|
||||
], |
|
||||
options={ |
|
||||
'db_table': 'abon_raw_password', |
|
||||
}, |
|
||||
), |
|
||||
migrations.AddField( |
|
||||
model_name='periodicpayforid', |
|
||||
name='account', |
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='abonapp.Abon', |
|
||||
verbose_name='Account'), |
|
||||
), |
|
||||
migrations.AddField( |
|
||||
model_name='periodicpayforid', |
|
||||
name='periodic_pay', |
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tariff_app.PeriodicPay', |
|
||||
verbose_name='Periodic pay'), |
|
||||
), |
|
||||
migrations.AddField( |
|
||||
model_name='passportinfo', |
|
||||
name='abon', |
|
||||
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, |
|
||||
to='abonapp.Abon'), |
|
||||
), |
|
||||
migrations.AddField( |
|
||||
model_name='invoiceforpayment', |
|
||||
name='abon', |
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='abonapp.Abon'), |
|
||||
), |
|
||||
migrations.AddField( |
|
||||
model_name='invoiceforpayment', |
|
||||
name='author', |
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, |
|
||||
related_name='+', to=settings.AUTH_USER_MODEL), |
|
||||
), |
|
||||
migrations.AddField( |
|
||||
model_name='alltimepaylog', |
|
||||
name='abon', |
|
||||
field=models.ForeignKey(blank=True, default=None, null=True, |
|
||||
on_delete=django.db.models.deletion.SET_DEFAULT, to='abonapp.Abon'), |
|
||||
), |
|
||||
migrations.AddField( |
|
||||
model_name='additionaltelephone', |
|
||||
name='abon', |
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='additional_telephones', |
|
||||
to='abonapp.Abon'), |
|
||||
), |
|
||||
migrations.AddField( |
|
||||
model_name='abonlog', |
|
||||
name='abon', |
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='abonapp.Abon'), |
|
||||
), |
|
||||
migrations.AddField( |
|
||||
model_name='abonlog', |
|
||||
name='author', |
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, |
|
||||
related_name='+', to=settings.AUTH_USER_MODEL), |
|
||||
), |
|
||||
migrations.AddField( |
|
||||
model_name='abon', |
|
||||
name='current_tariff', |
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, |
|
||||
to='abonapp.AbonTariff'), |
|
||||
), |
|
||||
migrations.AddField( |
|
||||
model_name='abon', |
|
||||
name='dev_port', |
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, |
|
||||
to='devapp.Port'), |
|
||||
), |
|
||||
migrations.AddField( |
|
||||
model_name='abon', |
|
||||
name='device', |
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, |
|
||||
to='devapp.Device'), |
|
||||
), |
|
||||
migrations.AddField( |
|
||||
model_name='abon', |
|
||||
name='extra_fields', |
|
||||
field=models.ManyToManyField(blank=True, to='abonapp.ExtraFieldsModel'), |
|
||||
), |
|
||||
migrations.AddField( |
|
||||
model_name='abon', |
|
||||
name='group', |
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, |
|
||||
to='group_app.Group', verbose_name='User group'), |
|
||||
), |
|
||||
migrations.AddField( |
|
||||
model_name='abon', |
|
||||
name='street', |
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, |
|
||||
to='abonapp.AbonStreet', verbose_name='Street'), |
|
||||
), |
|
||||
] |
|
||||
@ -1,155 +0,0 @@ |
|||||
# -*- coding: utf-8 -*- |
|
||||
# Generated by Django 1.11 on 2018-08-08 14:48 |
|
||||
from __future__ import unicode_literals |
|
||||
from ipaddress import ip_address, ip_network |
|
||||
from json import load |
|
||||
import os |
|
||||
from django.core import serializers |
|
||||
|
|
||||
import django.core.validators |
|
||||
from django.db import migrations, models |
|
||||
import django.db.models.deletion |
|
||||
import re |
|
||||
from ip_pool.models import NetworkModel, IpLeaseModel |
|
||||
|
|
||||
|
|
||||
TMP_FILE = '/tmp/djing_ip_field_abonapp_migrate.json' |
|
||||
|
|
||||
|
|
||||
def backup_info(apps, _): |
|
||||
Abon = apps.get_model('abonapp', 'Abon') |
|
||||
obs = Abon.objects.exclude(ip_address=None).only('ip_address', 'is_dynamic_ip') |
|
||||
if obs.exists(): |
|
||||
with open(TMP_FILE, 'w') as f: |
|
||||
serializers.serialize('json', obs, stream=f, fields=('ip_address', 'is_dynamic_ip')) |
|
||||
|
|
||||
|
|
||||
def restore_info_to_new_scheme(apps, _): |
|
||||
Abon = apps.get_model('abonapp', 'Abon') |
|
||||
if not os.path.isfile(TMP_FILE): |
|
||||
return |
|
||||
with open(TMP_FILE, 'r') as f: |
|
||||
for abon in load(f): |
|
||||
ip_addr = abon['fields'].get('ip_address') |
|
||||
if ip_addr is None: |
|
||||
continue |
|
||||
ip_addr = ip_address(ip_addr) |
|
||||
is_dynamic_ip = abon['fields'].get('is_dynamic_ip') |
|
||||
if is_dynamic_ip is None: |
|
||||
continue |
|
||||
|
|
||||
try: |
|
||||
ip_lease = IpLeaseModel.objects.get(ip=str(ip_addr)) |
|
||||
except IpLeaseModel.DoesNotExist: |
|
||||
net = ip_network((ip_addr, 24), strict=False) |
|
||||
try: |
|
||||
network = NetworkModel.objects.get(network=str(net)) |
|
||||
except NetworkModel.DoesNotExist: |
|
||||
ip_max = ip_address(int(ip_addr) | 0xfe) |
|
||||
ip_min = next(net.hosts()) |
|
||||
network = NetworkModel.objects.create( |
|
||||
network=str(net), |
|
||||
kind='inet', |
|
||||
description='Пользовательский диапазон', |
|
||||
ip_start=str(ip_min), |
|
||||
ip_end=str(ip_max) |
|
||||
) |
|
||||
ip_lease = IpLeaseModel.objects.create_from_ip( |
|
||||
ip=str(ip_addr), |
|
||||
net=network, |
|
||||
is_dynamic=is_dynamic_ip |
|
||||
) |
|
||||
abon_db = Abon.objects.filter(pk=abon['pk']).first() |
|
||||
if abon_db is not None: |
|
||||
abon_db.ip_addresses.add(ip_lease.pk) |
|
||||
print('\tUser %s: %s updated' % (abon_db.username, abon_db.fio)) |
|
||||
else: |
|
||||
print('\tUser with pk=%s not found' % abon['pk']) |
|
||||
if os.path.isfile(TMP_FILE): |
|
||||
os.remove(TMP_FILE) |
|
||||
|
|
||||
|
|
||||
class Migration(migrations.Migration): |
|
||||
|
|
||||
dependencies = [ |
|
||||
('ip_pool', '0001_initial'), |
|
||||
('abonapp', '0001_initial'), |
|
||||
] |
|
||||
|
|
||||
operations = [ |
|
||||
migrations.RunPython(backup_info), |
|
||||
migrations.AlterModelOptions( |
|
||||
name='abon', |
|
||||
options={'ordering': ('fio',), 'permissions': (('can_buy_tariff', 'Buy service perm'), ('can_view_passport', 'Can view passport'), ('can_add_ballance', 'fill account'), ('can_ping', 'Can ping')), 'verbose_name': 'Abon', 'verbose_name_plural': 'Abons'}, |
|
||||
), |
|
||||
migrations.AlterModelOptions( |
|
||||
name='abonlog', |
|
||||
options={'ordering': ('-date',), 'permissions': (('can_view_abonlog', 'Can view subscriber logs'),)}, |
|
||||
), |
|
||||
migrations.AlterModelOptions( |
|
||||
name='abonstreet', |
|
||||
options={'ordering': ('name',), 'verbose_name': 'Street', 'verbose_name_plural': 'Streets'}, |
|
||||
), |
|
||||
migrations.AlterModelOptions( |
|
||||
name='abontariff', |
|
||||
options={'ordering': ('time_start',), 'permissions': (('can_complete_service', 'finish service perm'),), 'verbose_name': 'Abon service', 'verbose_name_plural': 'Abon services'}, |
|
||||
), |
|
||||
migrations.AlterModelOptions( |
|
||||
name='allpaylog', |
|
||||
options={'ordering': ('-date_action',)}, |
|
||||
), |
|
||||
migrations.AlterModelOptions( |
|
||||
name='alltimepaylog', |
|
||||
options={'ordering': ('-date_add',)}, |
|
||||
), |
|
||||
migrations.AlterModelOptions( |
|
||||
name='passportinfo', |
|
||||
options={'ordering': ('series',), 'verbose_name': 'Passport Info', 'verbose_name_plural': 'Passport Info'}, |
|
||||
), |
|
||||
migrations.AlterModelOptions( |
|
||||
name='periodicpayforid', |
|
||||
options={'ordering': ('last_pay',)}, |
|
||||
), |
|
||||
migrations.RemoveField( |
|
||||
model_name='abon', |
|
||||
name='extra_fields', |
|
||||
), |
|
||||
migrations.RemoveField( |
|
||||
model_name='abon', |
|
||||
name='ip_address', |
|
||||
), |
|
||||
migrations.AddField( |
|
||||
model_name='abon', |
|
||||
name='ip_addresses', |
|
||||
field=models.ManyToManyField(to='ip_pool.IpLeaseModel', verbose_name='Ip addresses'), |
|
||||
), |
|
||||
migrations.AlterField( |
|
||||
model_name='additionaltelephone', |
|
||||
name='telephone', |
|
||||
field=models.CharField(max_length=16, validators=[django.core.validators.RegexValidator('^(\\+[7,8,9,3]\\d{10,11})?$')], verbose_name='Telephone'), |
|
||||
), |
|
||||
migrations.AlterField( |
|
||||
model_name='passportinfo', |
|
||||
name='abon', |
|
||||
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='abonapp.Abon'), |
|
||||
), |
|
||||
migrations.AlterField( |
|
||||
model_name='passportinfo', |
|
||||
name='distributor', |
|
||||
field=models.CharField(max_length=64, verbose_name='Distributor'), |
|
||||
), |
|
||||
migrations.AlterField( |
|
||||
model_name='passportinfo', |
|
||||
name='number', |
|
||||
field=models.CharField(max_length=6, validators=[django.core.validators.RegexValidator(re.compile('^-?\\d+\\Z', 32), code='invalid', message='Enter a valid integer.')], verbose_name='Pasport number'), |
|
||||
), |
|
||||
migrations.AlterField( |
|
||||
model_name='passportinfo', |
|
||||
name='series', |
|
||||
field=models.CharField(max_length=4, validators=[django.core.validators.RegexValidator(re.compile('^-?\\d+\\Z', 32), code='invalid', message='Enter a valid integer.')], verbose_name='Pasport serial'), |
|
||||
), |
|
||||
migrations.DeleteModel( |
|
||||
name='ExtraFieldsModel', |
|
||||
), |
|
||||
migrations.RunPython(restore_info_to_new_scheme) |
|
||||
] |
|
||||
@ -1,22 +0,0 @@ |
|||||
# -*- coding: utf-8 -*- |
|
||||
# Generated by Django 1.11 on 2018-08-16 18:40 |
|
||||
from __future__ import unicode_literals |
|
||||
|
|
||||
from django.db import migrations, models |
|
||||
import django.db.models.deletion |
|
||||
|
|
||||
|
|
||||
class Migration(migrations.Migration): |
|
||||
|
|
||||
dependencies = [ |
|
||||
('gw_app', '0001_initial'), |
|
||||
('abonapp', '0002_auto_20180808_1448'), |
|
||||
] |
|
||||
|
|
||||
operations = [ |
|
||||
migrations.AddField( |
|
||||
model_name='abon', |
|
||||
name='nas', |
|
||||
field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, to='gw_app.NASModel', verbose_name='Network access server'), |
|
||||
), |
|
||||
] |
|
||||
@ -1,44 +0,0 @@ |
|||||
# Generated by Django 2.1 on 2018-09-18 17:34 |
|
||||
|
|
||||
from django.db import migrations, models |
|
||||
|
|
||||
|
|
||||
class Migration(migrations.Migration): |
|
||||
|
|
||||
dependencies = [ |
|
||||
('abonapp', '0003_abon_nas'), |
|
||||
] |
|
||||
|
|
||||
operations = [ |
|
||||
migrations.AlterModelOptions( |
|
||||
name='abon', |
|
||||
options={'ordering': ('fio',), 'permissions': (('can_buy_tariff', 'Buy service perm'), ('can_add_ballance', 'fill account'), ('can_ping', 'Can ping')), 'verbose_name': 'Abon', 'verbose_name_plural': 'Abons'}, |
|
||||
), |
|
||||
migrations.AlterModelOptions( |
|
||||
name='abonlog', |
|
||||
options={'ordering': ('-date',)}, |
|
||||
), |
|
||||
migrations.AlterModelOptions( |
|
||||
name='additionaltelephone', |
|
||||
options={'ordering': ('owner_name',), 'verbose_name': 'Additional telephone', 'verbose_name_plural': 'Additional telephones'}, |
|
||||
), |
|
||||
migrations.AlterModelOptions( |
|
||||
name='invoiceforpayment', |
|
||||
options={'ordering': ('date_create',), 'verbose_name': 'Debt', 'verbose_name_plural': 'Debts'}, |
|
||||
), |
|
||||
migrations.AddField( |
|
||||
model_name='abon', |
|
||||
name='autoconnect_service', |
|
||||
field=models.BooleanField(default=False, verbose_name='Automatically connect next service'), |
|
||||
), |
|
||||
migrations.AlterField( |
|
||||
model_name='abon', |
|
||||
name='is_dynamic_ip', |
|
||||
field=models.BooleanField(default=False, verbose_name='Is dynamic ip'), |
|
||||
), |
|
||||
migrations.AlterField( |
|
||||
model_name='passportinfo', |
|
||||
name='date_of_acceptance', |
|
||||
field=models.DateField(verbose_name='Date of acceptance'), |
|
||||
), |
|
||||
] |
|
||||
@ -1,19 +0,0 @@ |
|||||
# Generated by Django 2.1 on 2018-09-22 14:24 |
|
||||
|
|
||||
from django.db import migrations, models |
|
||||
import django.db.models.deletion |
|
||||
|
|
||||
|
|
||||
class Migration(migrations.Migration): |
|
||||
dependencies = [ |
|
||||
('abonapp', '0004_auto_20180918_1734'), |
|
||||
] |
|
||||
|
|
||||
operations = [ |
|
||||
migrations.AlterField( |
|
||||
model_name='abon', |
|
||||
name='current_tariff', |
|
||||
field=models.OneToOneField(blank=True, default=None, null=True, |
|
||||
on_delete=django.db.models.deletion.SET_NULL, to='abonapp.AbonTariff'), |
|
||||
), |
|
||||
] |
|
||||
@ -1,51 +0,0 @@ |
|||||
# Generated by Django 2.1 on 2018-10-10 16:11 |
|
||||
# from json import dump |
|
||||
|
|
||||
from django.db import migrations, models |
|
||||
|
|
||||
TMP_FILE = '/tmp/migrate_ip.json' |
|
||||
|
|
||||
DUMP = [] |
|
||||
|
|
||||
|
|
||||
def backup_info(apps, _): |
|
||||
Abon = apps.get_model('abonapp', 'Abon') |
|
||||
abons = Abon.objects.annotate( |
|
||||
addr_count=models.Count('ip_addresses') |
|
||||
).filter(addr_count__gt=0).only('ip_addresses').iterator() |
|
||||
global DUMP |
|
||||
for abon in abons: |
|
||||
ip_addr = abon.ip_addresses.first() |
|
||||
DUMP.append({ |
|
||||
'pk': abon.pk, |
|
||||
'addr': ip_addr.ip |
|
||||
}) |
|
||||
# with open(TMP_FILE, 'w') as f: |
|
||||
# dump(r, f, indent=2) |
|
||||
|
|
||||
|
|
||||
def restore_ips(apps, _): |
|
||||
Abon = apps.get_model('abonapp', 'Abon') |
|
||||
for abon in DUMP: |
|
||||
Abon.objects.filter(pk=abon.get('pk')).update(ip_address=abon.get('addr')) |
|
||||
|
|
||||
|
|
||||
class Migration(migrations.Migration): |
|
||||
|
|
||||
dependencies = [ |
|
||||
('abonapp', '0005_current_tariff'), |
|
||||
] |
|
||||
|
|
||||
operations = [ |
|
||||
migrations.RunPython(backup_info), |
|
||||
migrations.RemoveField( |
|
||||
model_name='abon', |
|
||||
name='ip_addresses', |
|
||||
), |
|
||||
migrations.AddField( |
|
||||
model_name='abon', |
|
||||
name='ip_address', |
|
||||
field=models.GenericIPAddressField(blank=True, null=True, unique=True, verbose_name='Ip address'), |
|
||||
), |
|
||||
migrations.RunPython(restore_ips) |
|
||||
] |
|
||||
@ -1,23 +0,0 @@ |
|||||
# Generated by Django 2.1 on 2018-11-01 15:45 |
|
||||
|
|
||||
from django.db import migrations, models |
|
||||
|
|
||||
|
|
||||
class Migration(migrations.Migration): |
|
||||
|
|
||||
dependencies = [ |
|
||||
('gw_app', '0002_auto_20181101_1545'), |
|
||||
('abonapp', '0006_change_ip'), |
|
||||
] |
|
||||
|
|
||||
operations = [ |
|
||||
migrations.AlterField( |
|
||||
model_name='abon', |
|
||||
name='ip_address', |
|
||||
field=models.GenericIPAddressField(blank=True, null=True, verbose_name='Ip address'), |
|
||||
), |
|
||||
migrations.AlterUniqueTogether( |
|
||||
name='abon', |
|
||||
unique_together={('ip_address', 'nas')}, |
|
||||
), |
|
||||
] |
|
||||
@ -1,34 +0,0 @@ |
|||||
# Generated by Django 2.1 on 2018-11-15 12:06 |
|
||||
|
|
||||
from django.conf import settings |
|
||||
from django.db import migrations, models |
|
||||
import django.db.models.deletion |
|
||||
|
|
||||
|
|
||||
def fill_last_tariff(apps, _): |
|
||||
Abon = apps.get_model('abonapp', 'Abon') |
|
||||
for abon in Abon.objects.exclude(current_tariff=None): |
|
||||
abon.last_connected_tariff = abon.current_tariff.tariff |
|
||||
abon.save(update_fields=('last_connected_tariff',)) |
|
||||
|
|
||||
|
|
||||
class Migration(migrations.Migration): |
|
||||
|
|
||||
dependencies = [ |
|
||||
('tariff_app', '0003_auto_20181115_1206'), |
|
||||
('abonapp', '0007_auto_20181101_1545'), |
|
||||
] |
|
||||
|
|
||||
operations = [ |
|
||||
migrations.AddField( |
|
||||
model_name='abon', |
|
||||
name='last_connected_tariff', |
|
||||
field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, to='tariff_app.Tariff', verbose_name='Last connected service'), |
|
||||
), |
|
||||
migrations.AlterField( |
|
||||
model_name='abonlog', |
|
||||
name='author', |
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL), |
|
||||
), |
|
||||
migrations.RunPython(fill_last_tariff) |
|
||||
] |
|
||||
@ -1,69 +0,0 @@ |
|||||
# -*- coding: utf-8 -*- |
|
||||
# Generated by Django 1.11 on 2018-02-26 00:20 |
|
||||
from __future__ import unicode_literals |
|
||||
|
|
||||
from django.db import migrations, models |
|
||||
import django.db.models.deletion |
|
||||
import djing.fields |
|
||||
from djing.fields import MyGenericIPAddressField |
|
||||
|
|
||||
|
|
||||
class Migration(migrations.Migration): |
|
||||
initial = True |
|
||||
|
|
||||
dependencies = [ |
|
||||
('group_app', '0001_initial'), |
|
||||
] |
|
||||
|
|
||||
operations = [ |
|
||||
migrations.CreateModel( |
|
||||
name='Device', |
|
||||
fields=[ |
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
|
||||
('ip_address', MyGenericIPAddressField(max_length=8, protocol='ipv4', verbose_name='Ip address')), |
|
||||
('mac_addr', djing.fields.MACAddressField(blank=True, integer=True, null=True, unique=True, |
|
||||
verbose_name='Mac address')), |
|
||||
('comment', models.CharField(max_length=256, verbose_name='Comment')), |
|
||||
('devtype', models.CharField( |
|
||||
choices=[('Dl', 'DLink switch'), ('Pn', 'PON OLT'), ('On', 'PON ONU'), ('Ex', 'Eltex switch')], |
|
||||
default='Dl', max_length=2, verbose_name='Device type')), |
|
||||
('man_passw', models.CharField(blank=True, max_length=16, null=True, verbose_name='SNMP password')), |
|
||||
('snmp_item_num', models.PositiveSmallIntegerField(blank=True, default=0, verbose_name='SNMP Number')), |
|
||||
('status', |
|
||||
models.CharField(choices=[('und', 'Undefined'), ('up', 'Up'), ('unr', 'Unreachable'), ('dwn', 'Down')], |
|
||||
default='und', max_length=3, verbose_name='Status')), |
|
||||
('is_noticeable', |
|
||||
models.BooleanField(default=False, verbose_name='Send notify when monitoring state changed')), |
|
||||
('group', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, |
|
||||
to='group_app.Group', verbose_name='Device group')), |
|
||||
('parent_dev', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, |
|
||||
to='devapp.Device', verbose_name='Parent device')), |
|
||||
], |
|
||||
options={ |
|
||||
'verbose_name': 'Device', |
|
||||
'verbose_name_plural': 'Devices', |
|
||||
'db_table': 'dev', |
|
||||
'ordering': ['comment'] |
|
||||
}, |
|
||||
), |
|
||||
migrations.CreateModel( |
|
||||
name='Port', |
|
||||
fields=[ |
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
|
||||
('num', models.PositiveSmallIntegerField(default=0, verbose_name='Number')), |
|
||||
('descr', models.CharField(blank=True, max_length=60, null=True, verbose_name='Description')), |
|
||||
('device', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='devapp.Device', |
|
||||
verbose_name='Device')), |
|
||||
], |
|
||||
options={ |
|
||||
'verbose_name': 'Port', |
|
||||
'verbose_name_plural': 'Ports', |
|
||||
'db_table': 'dev_port', |
|
||||
'permissions': (('can_toggle_ports', 'Can toggle ports'),), |
|
||||
}, |
|
||||
), |
|
||||
migrations.AlterUniqueTogether( |
|
||||
name='port', |
|
||||
unique_together={('device', 'num')}, |
|
||||
), |
|
||||
] |
|
||||
@ -1,26 +0,0 @@ |
|||||
# -*- coding: utf-8 -*- |
|
||||
# Generated by Django 1.11 on 2018-04-09 13:18 |
|
||||
from __future__ import unicode_literals |
|
||||
|
|
||||
from django.db import migrations |
|
||||
from djing.fields import MyGenericIPAddressField |
|
||||
|
|
||||
|
|
||||
class Migration(migrations.Migration): |
|
||||
dependencies = [ |
|
||||
('devapp', '0001_initial'), |
|
||||
] |
|
||||
|
|
||||
operations = [ |
|
||||
migrations.AlterModelOptions( |
|
||||
name='device', |
|
||||
options={'ordering': ['id'], |
|
||||
'verbose_name': 'Device', 'verbose_name_plural': 'Devices'}, |
|
||||
), |
|
||||
migrations.AlterField( |
|
||||
model_name='device', |
|
||||
name='ip_address', |
|
||||
field=MyGenericIPAddressField(blank=True, max_length=8, null=True, protocol='ipv4', |
|
||||
verbose_name='Ip address'), |
|
||||
), |
|
||||
] |
|
||||
@ -1,60 +0,0 @@ |
|||||
# -*- coding: utf-8 -*- |
|
||||
# Generated by Django 1.11 on 2018-05-29 13:11 |
|
||||
from __future__ import unicode_literals |
|
||||
import os |
|
||||
from json import load |
|
||||
|
|
||||
from django.db import migrations, models |
|
||||
from django.core import serializers |
|
||||
|
|
||||
TMP_FILE = '/tmp/djing_snmp_info_backup.json' |
|
||||
|
|
||||
|
|
||||
def snmp_backup_info(apps, _): |
|
||||
Device = apps.get_model('devapp', 'Device') |
|
||||
obs = Device.objects.only('snmp_item_num') |
|
||||
with open(TMP_FILE, 'w') as f: |
|
||||
serializers.serialize('json', obs, stream=f, fields=('snmp_item_num',)) |
|
||||
|
|
||||
|
|
||||
def snmp_restore_info_to_new_scheme(apps, _): |
|
||||
Device = apps.get_model('devapp', 'Device') |
|
||||
with open(TMP_FILE, 'r') as f: |
|
||||
for device in load(f): |
|
||||
Device.objects.filter(pk=device['pk']).update(snmp_extra=device['fields']['snmp_item_num']) |
|
||||
if os.path.isfile(TMP_FILE): |
|
||||
os.remove(TMP_FILE) |
|
||||
|
|
||||
|
|
||||
class Migration(migrations.Migration): |
|
||||
|
|
||||
dependencies = [ |
|
||||
('devapp', '0002_auto_20180409_1318'), |
|
||||
] |
|
||||
|
|
||||
operations = [ |
|
||||
migrations.RunPython(snmp_backup_info), |
|
||||
migrations.AlterModelOptions( |
|
||||
name='device', |
|
||||
options={'ordering': ('id',), 'verbose_name': 'Device', 'verbose_name_plural': 'Devices'}, |
|
||||
), |
|
||||
migrations.AlterModelOptions( |
|
||||
name='port', |
|
||||
options={'ordering': ('num',), 'permissions': (('can_toggle_ports', 'Can toggle ports'),), 'verbose_name': 'Port', 'verbose_name_plural': 'Ports'}, |
|
||||
), |
|
||||
migrations.RemoveField( |
|
||||
model_name='device', |
|
||||
name='snmp_item_num', |
|
||||
), |
|
||||
migrations.AddField( |
|
||||
model_name='device', |
|
||||
name='snmp_extra', |
|
||||
field=models.CharField(blank=True, max_length=256, null=True, verbose_name='SNMP extra info'), |
|
||||
), |
|
||||
migrations.AlterField( |
|
||||
model_name='device', |
|
||||
name='devtype', |
|
||||
field=models.CharField(choices=[('Dl', 'DLink switch'), ('Pn', 'PON OLT'), ('On', 'PON ONU'), ('Ex', 'Eltex switch'), ('Zt', 'OLT ZTE C320'), ('Zo', 'ZTE PON ONU')], default='Dl', max_length=2, verbose_name='Device type'), |
|
||||
), |
|
||||
migrations.RunPython(snmp_restore_info_to_new_scheme) |
|
||||
] |
|
||||
@ -1,21 +0,0 @@ |
|||||
# -*- coding: utf-8 -*- |
|
||||
# Generated by Django 1.11 on 2018-06-07 10:59 |
|
||||
from __future__ import unicode_literals |
|
||||
|
|
||||
from django.db import migrations |
|
||||
import jsonfield.fields |
|
||||
|
|
||||
|
|
||||
class Migration(migrations.Migration): |
|
||||
|
|
||||
dependencies = [ |
|
||||
('devapp', '0003_auto_20180529_1311'), |
|
||||
] |
|
||||
|
|
||||
operations = [ |
|
||||
migrations.AddField( |
|
||||
model_name='device', |
|
||||
name='extra_data', |
|
||||
field=jsonfield.fields.JSONField(blank=True, help_text='Extra data in JSON format. You may use it for your custom data', null=True, verbose_name='Extra data'), |
|
||||
), |
|
||||
] |
|
||||
@ -1,44 +0,0 @@ |
|||||
# -*- coding: utf-8 -*- |
|
||||
# Generated by Django 1.11 on 2018-08-08 17:31 |
|
||||
from __future__ import unicode_literals |
|
||||
from json import load |
|
||||
import os |
|
||||
from django.core import serializers |
|
||||
|
|
||||
from django.db import migrations, models |
|
||||
|
|
||||
|
|
||||
TMP_FILE = '/tmp/djing_ip_field_devapp_migrate.json' |
|
||||
|
|
||||
|
|
||||
def device_backup_info(apps, _): |
|
||||
Device = apps.get_model('devapp', 'Device') |
|
||||
obs = Device.objects.exclude(ip_address=None).only('ip_address') |
|
||||
with open(TMP_FILE, 'w') as f: |
|
||||
serializers.serialize('json', obs, stream=f, fields=('ip_address',)) |
|
||||
|
|
||||
|
|
||||
def device_restore_info_to_new_scheme(apps, _): |
|
||||
Device = apps.get_model('devapp', 'Device') |
|
||||
with open(TMP_FILE, 'r') as f: |
|
||||
for device in load(f): |
|
||||
Device.objects.filter(pk=device['pk']).update(ip_address=device['fields']['ip_address']) |
|
||||
if os.path.isfile(TMP_FILE): |
|
||||
os.remove(TMP_FILE) |
|
||||
|
|
||||
|
|
||||
class Migration(migrations.Migration): |
|
||||
dependencies = [ |
|
||||
('devapp', '0004_device_extra_data'), |
|
||||
] |
|
||||
|
|
||||
operations = [ |
|
||||
migrations.RunPython(device_backup_info), |
|
||||
migrations.RemoveField(model_name='device', name='ip_address'), |
|
||||
migrations.AddField( |
|
||||
model_name='device', |
|
||||
name='ip_address', |
|
||||
field=models.GenericIPAddressField(blank=True, null=True, verbose_name='Ip address') |
|
||||
), |
|
||||
migrations.RunPython(device_restore_info_to_new_scheme) |
|
||||
] |
|
||||
@ -1,65 +0,0 @@ |
|||||
# -*- coding: utf-8 -*- |
|
||||
# Generated by Django 1.11 on 2018-08-07 15:48 |
|
||||
from __future__ import unicode_literals |
|
||||
|
|
||||
from django.db import migrations, models |
|
||||
import django.db.models.deletion |
|
||||
import djing.fields |
|
||||
import ip_pool.fields |
|
||||
|
|
||||
|
|
||||
class Migration(migrations.Migration): |
|
||||
|
|
||||
initial = True |
|
||||
|
|
||||
dependencies = [ |
|
||||
('group_app', '0002_group_code'), |
|
||||
] |
|
||||
|
|
||||
operations = [ |
|
||||
migrations.CreateModel( |
|
||||
name='IpLeaseModel', |
|
||||
fields=[ |
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
|
||||
('ip', models.GenericIPAddressField(unique=True, verbose_name='Ip address')), |
|
||||
('mac_addr', djing.fields.MACAddressField(blank=True, integer=True, null=True, unique=True, verbose_name='Mac address')), |
|
||||
('lease_time', models.DateTimeField(auto_now_add=True, verbose_name='Lease time')), |
|
||||
('is_dynamic', models.BooleanField(default=False, verbose_name='Is dynamic')), |
|
||||
('is_active', models.BooleanField(default=True, verbose_name='Is active')), |
|
||||
('device_info', models.CharField(blank=True, default=None, max_length=128, null=True)), |
|
||||
], |
|
||||
options={ |
|
||||
'verbose_name': 'Employed ip', |
|
||||
'verbose_name_plural': 'Employed ip addresses', |
|
||||
'db_table': 'ip_pool_employed_ip', |
|
||||
'ordering': ('-id',), |
|
||||
}, |
|
||||
), |
|
||||
migrations.CreateModel( |
|
||||
name='NetworkModel', |
|
||||
fields=[ |
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
|
||||
('network', ip_pool.fields.GenericIpAddressWithPrefix(help_text='Ip address of network. For example: 192.168.1.0 or fde8:6789:1234:1::', unique=True, verbose_name='IP network')), |
|
||||
('kind', models.CharField(choices=[('inet', 'Internet'), ('guest', 'Guest'), ('trust', 'Trusted'), ('device', 'Devices'), ('admin', 'Admin')], default='guest', max_length=6, verbose_name='Kind of network')), |
|
||||
('description', models.CharField(max_length=64, verbose_name='Description')), |
|
||||
('ip_start', models.GenericIPAddressField(verbose_name='Start work ip range')), |
|
||||
('ip_end', models.GenericIPAddressField(verbose_name='End work ip range')), |
|
||||
('groups', models.ManyToManyField(to='group_app.Group', verbose_name='Groups')), |
|
||||
], |
|
||||
options={ |
|
||||
'verbose_name': 'Network', |
|
||||
'verbose_name_plural': 'Networks', |
|
||||
'db_table': 'ip_pool_network', |
|
||||
'ordering': ('network',), |
|
||||
}, |
|
||||
), |
|
||||
migrations.AddField( |
|
||||
model_name='ipleasemodel', |
|
||||
name='network', |
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ip_pool.NetworkModel', verbose_name='Parent network', blank=True, null=True), |
|
||||
), |
|
||||
migrations.AlterUniqueTogether( |
|
||||
name='ipleasemodel', |
|
||||
unique_together={('ip', 'network')}, |
|
||||
), |
|
||||
] |
|
||||
@ -1,23 +0,0 @@ |
|||||
# Generated by Django 2.1 on 2018-10-05 15:17 |
|
||||
|
|
||||
from django.db import migrations |
|
||||
import djing.fields |
|
||||
|
|
||||
|
|
||||
class Migration(migrations.Migration): |
|
||||
|
|
||||
dependencies = [ |
|
||||
('ip_pool', '0001_initial'), |
|
||||
] |
|
||||
|
|
||||
operations = [ |
|
||||
migrations.AlterField( |
|
||||
model_name='ipleasemodel', |
|
||||
name='mac_addr', |
|
||||
field=djing.fields.MACAddressField(blank=True, integer=True, null=True, verbose_name='Mac address'), |
|
||||
), |
|
||||
migrations.AlterUniqueTogether( |
|
||||
name='ipleasemodel', |
|
||||
unique_together={('ip', 'network', 'mac_addr')}, |
|
||||
), |
|
||||
] |
|
||||
@ -1,50 +0,0 @@ |
|||||
# Generated by Django 2.1 on 2018-10-19 12:30 |
|
||||
|
|
||||
from django.db import migrations, models |
|
||||
import djing.fields |
|
||||
|
|
||||
|
|
||||
class Migration(migrations.Migration): |
|
||||
|
|
||||
dependencies = [ |
|
||||
('ip_pool', '0002_change_unique'), |
|
||||
] |
|
||||
|
|
||||
operations = [ |
|
||||
migrations.CreateModel( |
|
||||
name='LeasesHistory', |
|
||||
fields=[ |
|
||||
('id', models.AutoField( |
|
||||
auto_created=True, |
|
||||
primary_key=True, |
|
||||
serialize=False, |
|
||||
verbose_name='ID' |
|
||||
)), |
|
||||
('ip', models.GenericIPAddressField(verbose_name='Ip address')), |
|
||||
('lease_time', models.DateTimeField( |
|
||||
auto_now_add=True, |
|
||||
verbose_name='Lease time' |
|
||||
)), |
|
||||
('mac_addr', djing.fields.MACAddressField( |
|
||||
blank=True, |
|
||||
integer=True, |
|
||||
null=True, |
|
||||
verbose_name='Mac address' |
|
||||
)), |
|
||||
], |
|
||||
options={ |
|
||||
'verbose_name': 'History lease', |
|
||||
'verbose_name_plural': 'Leases history', |
|
||||
'db_table': 'ip_pool_leases_history', |
|
||||
'ordering': ('-lease_time',), |
|
||||
}, |
|
||||
), |
|
||||
migrations.RemoveField( |
|
||||
model_name='ipleasemodel', |
|
||||
name='is_active', |
|
||||
), |
|
||||
migrations.RemoveField( |
|
||||
model_name='ipleasemodel', |
|
||||
name='is_dynamic', |
|
||||
), |
|
||||
] |
|
||||
@ -1,15 +0,0 @@ |
|||||
# Generated by Django 2.1.1 on 2019-03-05 12:43 |
|
||||
|
|
||||
from django.db import migrations |
|
||||
|
|
||||
|
|
||||
class Migration(migrations.Migration): |
|
||||
|
|
||||
dependencies = [ |
|
||||
('ip_pool', '0003_auto_20181019_1230'), |
|
||||
] |
|
||||
|
|
||||
operations = [ |
|
||||
migrations.DeleteModel(name='IpLeaseModel'), |
|
||||
migrations.DeleteModel(name='LeasesHistory') |
|
||||
] |
|
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue