示例#1
0
class Migration(migrations.Migration):

    dependencies = [
        ("customers",
         "0008_change_find_customer_service_by_device_credentials_fn"),
        ("networks", "0013_update_dhcp_commit_lease_add_update_fn"),
    ]

    operations = [
        migrations.AlterField(
            model_name="customeripleasemodel",
            name="customer",
            field=models.ForeignKey(null=True,
                                    on_delete=CASCADE,
                                    to="customers.Customer"),
        ),
        migrations.AddField(
            model_name="customeripleaselog",
            name="end_use_time",
            field=models.DateTimeField(blank=True,
                                       default=None,
                                       null=True,
                                       verbose_name="Lease end use time"),
        ),
        migrations.RunSQL(sql=read_all_file(
            "0014_update_find_new_ip_pool_lease_fn.sql", __file__)),
    ]
示例#2
0
class Migration(migrations.Migration):

    dependencies = [
        ("networks", "0005_networkippool_tag"),
    ]

    operations = [
        migrations.AlterField(
            model_name="networkippool",
            name="pool_tag",
            field=models.CharField(
                blank=True,
                default=None,
                max_length=32,
                null=True,
                validators=[
                    RegexValidator(
                        re.compile("^[-a-zA-Z0-9_]+\\Z"),
                        "Enter a valid “slug” consisting of letters, numbers, underscores or hyphens.",
                        "invalid",
                    )
                ],
                verbose_name="Tag",
            ),
        ),
        migrations.RunSQL(sql=read_all_file(
            "0006_change_fetch_subscriber_lease.sql", __file__)),
    ]
示例#3
0
class Migration(migrations.Migration):

    dependencies = [
        ("customers", "0007_passportinfo_division_code"),
        ("networks", "0011_ip_addr_index"),
    ]

    operations = [
        migrations.CreateModel(
            name="CustomerIpLeaseLog",
            fields=[
                ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("ip_address", models.GenericIPAddressField(verbose_name="Ip address")),
                ("lease_time", models.DateTimeField(auto_now_add=True, verbose_name="Lease time")),
                ("last_update", models.DateTimeField(blank=True, default=None, null=True, verbose_name="Last update")),
                ("mac_address", netfields.fields.MACAddressField(default=None, null=True, verbose_name="Mac address")),
                ("is_dynamic", models.BooleanField(default=False, verbose_name="Is synamic")),
                ("event_time", models.DateTimeField(auto_now_add=True, verbose_name="Event time")),
                ("customer", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="customers.Customer")),
            ],
            options={
                "db_table": "networks_ip_lease_log",
            },
        ),
        migrations.RunSQL(sql=read_all_file("0012_customeripleaselog.sql", __file__)),
    ]
示例#4
0
class Migration(migrations.Migration):

    dependencies = [
        ("networks", "0009_auto_20201109_1437"),
    ]

    operations = [
        migrations.RunSQL(sql=read_all_file("0010_find_service_permit_updated.sql", __file__)),
    ]
示例#5
0
class Migration(migrations.Migration):

    dependencies = [
        ("customers", "0006_additionaltelephone_create_time"),
        ("traf_stat", "0001_initial"),
    ]

    operations = [
        migrations.CreateModel(
            name="TrafficCache",
            fields=[
                ("id",
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name="ID")),
                ("customer",
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to="customers.Customer")),
                ("event_time", models.DateTimeField()),
                ("ip_addr", models.GenericIPAddressField()),
                ("octets", models.PositiveIntegerField(default=0)),
                ("packets", models.PositiveIntegerField(default=0)),
            ],
            options={
                "db_table": "traf_cache",
                "ordering": ("-event_time", ),
                "unique_together": {("customer", "ip_addr")},
            },
            bases=(djing2.models.BaseAbstractModelMixin, models.Model),
        ),
        migrations.DeleteModel(name="StatCache", ),
        migrations.CreateModel(
            name="TrafficArchiveModel",
            fields=[
                ("id",
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name="ID")),
                ("event_time", models.DateTimeField()),
                ("octets", models.PositiveIntegerField(default=0)),
                ("packets", models.PositiveIntegerField(default=0)),
                ("customer",
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to="customers.Customer")),
            ],
            options={
                "db_table": "traf_archive",
                "unique_together": {("customer", "event_time")},
            },
            bases=(djing2.models.BaseAbstractModelMixin, models.Model),
        ),
        migrations.RunSQL(
            sql=read_all_file("0002_auto_20210110_2006.sql", __file__)),
    ]
示例#6
0
class Migration(migrations.Migration):

    dependencies = [
        ("networks", "0012_customeripleaselog"),
    ]

    operations = [
        migrations.RunSQL(sql=read_all_file(
            "0013_update_dhcp_commit_lease_add_update_fn.sql", __file__))
    ]
示例#7
0
class Migration(migrations.Migration):

    dependencies = [
        ("networks", "0006_change_fetch_subscriber_lease"),
    ]

    operations = [
        migrations.RunSQL(
            sql=read_all_file("0007_signal_from_external_dhcp.sql", __file__))
    ]
示例#8
0
class Migration(migrations.Migration):

    dependencies = [
        ("customers", "0007_passportinfo_division_code"),
    ]

    operations = [
        migrations.RunSQL(sql=read_all_file(
            "0008_change_find_customer_service_by_device_credentials_fn.sql",
            __file__))
    ]
示例#9
0
class Migration(migrations.Migration):

    dependencies = [
        ("gateways", "0003_auto_20201014_1859"),
    ]

    operations = [
        migrations.RunSQL(
            sql=read_all_file("0004_fetch_credentials_params.sql", __file__),
            reverse_sql="DROP FUNCTION IF EXISTS fetch_customers_srvnet_credentials_by_gw;",
        )
    ]
示例#10
0
class Migration(migrations.Migration):

    dependencies = [
        ("gateways", "0001_initial"),
    ]

    operations = [
        migrations.RunSQL(
            sql=read_all_file("0002_fetch_credentials.sql", __file__),
            reverse_sql=
            "DROP FUNCTION IF EXISTS fetch_customers_srvnet_credentials_by_gw;",
        )
    ]
示例#11
0
class Migration(migrations.Migration):

    dependencies = [
        ("customers", "0001_initial"),
    ]

    operations = [
        migrations.RunSQL(
            sql=read_all_file("0002_add_procedures.sql", __file__),
            reverse_sql=
            "DROP FUNCTION IF EXISTS find_customer_service_by_ip( inet );",
        )
    ]
示例#12
0
class Migration(migrations.Migration):

    dependencies = [
        ("customers", "0004_auto_20201014_1859"),
    ]

    operations = [
        migrations.RunSQL(
            sql=read_all_file(
                "0005_find_customer_service_by_device_credentials.sql",
                __file__),
            reverse_sql=
            "DROP FUNCTION IF EXISTS find_customer_service_by_device_credentials( macaddr, smallint );",
        )
    ]
示例#13
0
class Migration(migrations.Migration):

    dependencies = [
        ("profiles", "0003_baseaccount_sites"),
    ]

    operations = [
        migrations.AddField(
            model_name="baseaccount",
            name="last_update_time",
            field=models.DateTimeField(blank=True,
                                       default=None,
                                       null=True,
                                       verbose_name="Last update time"),
        ),
        migrations.RunSQL(sql=read_all_file(
            "0004_baseaccount_last_update_time_trigger.sql", __file__), ),
    ]
示例#14
0
class Migration(migrations.Migration):

    dependencies = [
        ("networks", "0004_networkippool_is_dynamic"),
    ]

    operations = [
        migrations.AddField(
            model_name="networkippool",
            name="pool_tag",
            field=models.CharField(blank=True,
                                   default=None,
                                   max_length=32,
                                   null=True,
                                   verbose_name="Tag"),
        ),
        migrations.RunSQL(
            sql=read_all_file("0005_networkippool_tag.sql", __file__)),
    ]
示例#15
0
class Migration(migrations.Migration):

    dependencies = [
        ("networks", "0007_signal_from_external_dhcp"),
    ]

    operations = [
        migrations.AlterModelOptions(
            name="customeripleasemodel",
            options={"ordering": ("id",), "verbose_name": "IP lease", "verbose_name_plural": "IP leases"},
        ),
        migrations.AlterModelOptions(
            name="vlanif",
            options={"ordering": ("vid",), "verbose_name": "Vlan", "verbose_name_plural": "Vlan list"},
        ),
        migrations.AddField(
            model_name="customeripleasemodel",
            name="last_update",
            field=models.DateTimeField(blank=True, default=None, null=True, verbose_name="Last update"),
        ),
        migrations.RunSQL(sql=read_all_file("0008_update_lease_last_update_time.sql", __file__)),
    ]
示例#16
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("customers", "0005_find_customer_service_by_device_credentials"),
    ]

    operations = [
        migrations.CreateModel(
            name="UserSession",
            fields=[
                ("id",
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name="ID")),
                (
                    "assign_time",
                    models.DateTimeField(
                        auto_now_add=True,
                        help_text="Time when session assigned first time"),
                ),
                ("last_event_time",
                 models.DateTimeField(verbose_name="Last update time")),
                ("radius_username",
                 models.CharField(
                     max_length=32,
                     verbose_name="User-Name av pair from radius")),
                ("framed_ip_addr",
                 models.GenericIPAddressField(
                     verbose_name="Framed-IP-Address")),
                ("session_id",
                 models.UUIDField(verbose_name="Unique session id")),
                (
                    "session_duration",
                    models.DurationField(
                        blank=True,
                        default=None,
                        null=True,
                        verbose_name=
                        "most often this is Acct-Session-Time av pair",
                    ),
                ),
                ("input_octets", models.BigIntegerField(default=0)),
                ("output_octets", models.BigIntegerField(default=0)),
                ("input_packets", models.BigIntegerField(default=0)),
                ("output_packets", models.BigIntegerField(default=0)),
                ("closed",
                 models.BooleanField(default=False,
                                     verbose_name="Is session finished")),
                ("customer",
                 models.ForeignKey(on_delete=CASCADE,
                                   to="customers.Customer")),
            ],
            options={
                "db_table": "user_session",
            },
        ),
        migrations.RunSQL(
            sql=read_all_file("0001_initial.sql", __file__),
            reverse_sql="DROP FUNCTION IF EXISTS create_or_update_radius_session"
            "( uuid, inet, macaddr, smallint, integer, varchar(32), integer, "
            "integer, integer, integer, boolean );",
        ),
    ]
示例#17
0
class Migration(migrations.Migration):

    dependencies = [
        ("networks", "0013_update_dhcp_commit_lease_add_update_fn"),
        ("customers", "0007_passportinfo_division_code"),
        ("radiusapp", "0001_initial"),
    ]

    operations = [
        migrations.CreateModel(
            name="CustomerRadiusSession",
            fields=[
                ("id",
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name="ID")),
                (
                    "assign_time",
                    models.DateTimeField(
                        auto_now_add=True,
                        help_text="Time when session assigned first time"),
                ),
                ("last_event_time",
                 models.DateTimeField(verbose_name="Last update time")),
                ("radius_username",
                 models.CharField(
                     max_length=128,
                     verbose_name="User-Name av pair from radius")),
                ("session_id",
                 models.UUIDField(verbose_name="Unique session id")),
                (
                    "session_duration",
                    models.DurationField(
                        blank=True,
                        default=None,
                        null=True,
                        verbose_name=
                        "most often this is Acct-Session-Time av pair",
                    ),
                ),
                ("input_octets", models.BigIntegerField(default=0)),
                ("output_octets", models.BigIntegerField(default=0)),
                ("input_packets", models.BigIntegerField(default=0)),
                ("output_packets", models.BigIntegerField(default=0)),
                ("closed",
                 models.BooleanField(default=False,
                                     verbose_name="Is session finished")),
                ("customer",
                 models.ForeignKey(default=None,
                                   null=True,
                                   on_delete=CASCADE,
                                   to="customers.Customer")),
                (
                    "ip_lease",
                    models.OneToOneField(on_delete=CASCADE,
                                         to="networks.CustomerIpLeaseModel",
                                         verbose_name="Ip lease"),
                ),
            ],
            options={
                "db_table": "radius_customer_session",
            },
        ),
        migrations.DeleteModel(name="UserSession", ),
        migrations.RunSQL(
            sql=read_all_file("0002_auto_20210219_2055.sql", __file__)),
        migrations.RunPython(create_default_vlan),
    ]