# Generated by Django 1.11.4 on 2017-08-03 22:13


import django.contrib.auth.models
import django.core.validators
import django.db.models.deletion
import django.db.models.manager
import django.utils.timezone
import django_countries.fields
import django_handleref.models
import django_inet.models
import django_peeringdb.models.abstract
from django.conf import settings
from django.db import migrations, models

import peeringdb_server.models


class Migration(migrations.Migration):
    initial = True

    dependencies = [
        ("contenttypes", "0002_remove_content_type_name"),
        ("auth", "0008_alter_user_username_max_length"),
    ]

    operations = [
        migrations.CreateModel(
            name="User",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("password", models.CharField(max_length=128, verbose_name="password")),
                (
                    "last_login",
                    models.DateTimeField(
                        blank=True, null=True, verbose_name="last login"
                    ),
                ),
                (
                    "is_superuser",
                    models.BooleanField(
                        default=False,
                        help_text="Designates that this user has all permissions without explicitly assigning them.",
                        verbose_name="superuser status",
                    ),
                ),
                (
                    "username",
                    models.CharField(
                        help_text="Required. Letters, digits and [@.+-/_=|] only.",
                        max_length=254,
                        unique=True,
                        validators=[
                            django.core.validators.RegexValidator(
                                r"^[\\w\\.@+-=|/]+$",
                                "Enter a valid username.",
                                "invalid",
                                flags=32,
                            )
                        ],
                        verbose_name="username",
                    ),
                ),
                (
                    "email",
                    models.EmailField(max_length=254, verbose_name="email address"),
                ),
                (
                    "first_name",
                    models.CharField(
                        blank=True, max_length=254, verbose_name="first name"
                    ),
                ),
                (
                    "last_name",
                    models.CharField(
                        blank=True, max_length=254, verbose_name="last name"
                    ),
                ),
                (
                    "is_staff",
                    models.BooleanField(
                        default=False,
                        help_text="Designates whether the user can log into admin site.",
                        verbose_name="staff status",
                    ),
                ),
                (
                    "is_active",
                    models.BooleanField(
                        default=True,
                        help_text="Designates whether this user should be treated as active. Unselect this instead of deleting accounts.",
                        verbose_name="active",
                    ),
                ),
                (
                    "date_joined",
                    models.DateTimeField(
                        default=django.utils.timezone.now, verbose_name="date joined"
                    ),
                ),
                (
                    "created",
                    django_handleref.models.CreatedDateTimeField(
                        auto_now_add=True, verbose_name="Created"
                    ),
                ),
                (
                    "updated",
                    django_handleref.models.UpdatedDateTimeField(
                        auto_now=True, verbose_name="Updated"
                    ),
                ),
                (
                    "status",
                    models.CharField(
                        default=b"ok", max_length=254, verbose_name="status"
                    ),
                ),
            ],
            options={
                "db_table": "peeringdb_user",
                "verbose_name": "user",
                "verbose_name_plural": "users",
            },
            managers=[
                ("objects", django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name="Facility",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "status",
                    models.CharField(blank=True, max_length=255, verbose_name="Status"),
                ),
                (
                    "created",
                    django_handleref.models.CreatedDateTimeField(
                        auto_now_add=True, verbose_name="Created"
                    ),
                ),
                (
                    "updated",
                    django_handleref.models.UpdatedDateTimeField(
                        auto_now=True, verbose_name="Updated"
                    ),
                ),
                ("version", models.IntegerField(default=0)),
                ("address1", models.CharField(blank=True, max_length=255)),
                ("address2", models.CharField(blank=True, max_length=255)),
                ("city", models.CharField(blank=True, max_length=255)),
                ("state", models.CharField(blank=True, max_length=255)),
                ("zipcode", models.CharField(blank=True, max_length=48)),
                (
                    "country",
                    django_countries.fields.CountryField(blank=True, max_length=2),
                ),
                ("name", models.CharField(max_length=255, unique=True)),
                (
                    "website",
                    django_peeringdb.models.abstract.URLField(
                        blank=True, max_length=255
                    ),
                ),
                ("clli", models.CharField(blank=True, max_length=18)),
                ("rencode", models.CharField(blank=True, max_length=18)),
                ("npanxx", models.CharField(blank=True, max_length=21)),
                ("notes", models.TextField(blank=True)),
            ],
            options={
                "abstract": False,
                "db_table": "peeringdb_facility",
                "verbose_name_plural": "Facilities",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name="InternetExchange",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "status",
                    models.CharField(blank=True, max_length=255, verbose_name="Status"),
                ),
                (
                    "created",
                    django_handleref.models.CreatedDateTimeField(
                        auto_now_add=True, verbose_name="Created"
                    ),
                ),
                (
                    "updated",
                    django_handleref.models.UpdatedDateTimeField(
                        auto_now=True, verbose_name="Updated"
                    ),
                ),
                ("version", models.IntegerField(default=0)),
                ("name", models.CharField(max_length=64, unique=True)),
                ("name_long", models.CharField(blank=True, max_length=254)),
                ("city", models.CharField(max_length=192)),
                ("country", django_countries.fields.CountryField(max_length=2)),
                ("notes", models.TextField(blank=True)),
                (
                    "region_continent",
                    models.CharField(
                        choices=[
                            (b"North America", b"North America"),
                            (b"Asia Pacific", b"Asia Pacific"),
                            (b"Europe", b"Europe"),
                            (b"South America", b"South America"),
                            (b"Africa", b"Africa"),
                            (b"Australia", b"Australia"),
                            (b"Middle East", b"Middle East"),
                        ],
                        max_length=255,
                    ),
                ),
                (
                    "media",
                    models.CharField(
                        choices=[
                            (b"Ethernet", b"Ethernet"),
                            (b"ATM", b"ATM"),
                            (b"Multiple", b"Multiple"),
                        ],
                        max_length=128,
                    ),
                ),
                ("proto_unicast", models.BooleanField(default=False)),
                ("proto_multicast", models.BooleanField(default=False)),
                ("proto_ipv6", models.BooleanField(default=False)),
                (
                    "website",
                    django_peeringdb.models.abstract.URLField(
                        blank=True, max_length=255
                    ),
                ),
                (
                    "url_stats",
                    django_peeringdb.models.abstract.URLField(
                        blank=True, max_length=255
                    ),
                ),
                ("tech_email", models.EmailField(blank=True, max_length=254)),
                ("tech_phone", models.CharField(blank=True, max_length=192)),
                ("policy_email", models.EmailField(blank=True, max_length=254)),
                ("policy_phone", models.CharField(blank=True, max_length=192)),
            ],
            options={
                "abstract": False,
                "db_table": "peeringdb_ix",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name="InternetExchangeFacility",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "status",
                    models.CharField(blank=True, max_length=255, verbose_name="Status"),
                ),
                (
                    "created",
                    django_handleref.models.CreatedDateTimeField(
                        auto_now_add=True, verbose_name="Created"
                    ),
                ),
                (
                    "updated",
                    django_handleref.models.UpdatedDateTimeField(
                        auto_now=True, verbose_name="Updated"
                    ),
                ),
                ("version", models.IntegerField(default=0)),
                (
                    "facility",
                    models.ForeignKey(
                        default=0,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ixfac_set",
                        to="peeringdb_server.Facility",
                    ),
                ),
                (
                    "ix",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ixfac_set",
                        to="peeringdb_server.InternetExchange",
                    ),
                ),
            ],
            options={
                "db_table": "peeringdb_ix_facility",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name="IXLan",
            fields=[
                ("id", models.IntegerField(primary_key=True, serialize=False)),
                (
                    "status",
                    models.CharField(blank=True, max_length=255, verbose_name="Status"),
                ),
                (
                    "created",
                    django_handleref.models.CreatedDateTimeField(
                        auto_now_add=True, verbose_name="Created"
                    ),
                ),
                (
                    "updated",
                    django_handleref.models.UpdatedDateTimeField(
                        auto_now=True, verbose_name="Updated"
                    ),
                ),
                ("version", models.IntegerField(default=0)),
                ("name", models.CharField(blank=True, max_length=255)),
                ("descr", models.TextField(blank=True)),
                ("mtu", models.PositiveIntegerField(blank=True, null=True)),
                ("vlan", models.PositiveIntegerField(blank=True, null=True)),
                ("dot1q_support", models.BooleanField(default=False)),
                (
                    "rs_asn",
                    django_inet.models.ASNField(blank=True, default=0, null=True),
                ),
                (
                    "arp_sponge",
                    django_inet.models.MacAddressField(
                        blank=True, max_length=17, null=True, unique=True
                    ),
                ),
                (
                    "ix",
                    models.ForeignKey(
                        default=0,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ixlan_set",
                        to="peeringdb_server.InternetExchange",
                    ),
                ),
            ],
            options={
                "db_table": "peeringdb_ixlan",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name="IXLanPrefix",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "status",
                    models.CharField(blank=True, max_length=255, verbose_name="Status"),
                ),
                (
                    "created",
                    django_handleref.models.CreatedDateTimeField(
                        auto_now_add=True, verbose_name="Created"
                    ),
                ),
                (
                    "updated",
                    django_handleref.models.UpdatedDateTimeField(
                        auto_now=True, verbose_name="Updated"
                    ),
                ),
                ("version", models.IntegerField(default=0)),
                ("notes", models.CharField(blank=True, max_length=255)),
                (
                    "protocol",
                    models.CharField(
                        choices=[(b"IPv4", b"IPv4"), (b"IPv6", b"IPv6")], max_length=64
                    ),
                ),
                (
                    "prefix",
                    django_inet.models.IPPrefixField(max_length=43, unique=True),
                ),
                (
                    "ixlan",
                    models.ForeignKey(
                        default=0,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ixpfx_set",
                        to="peeringdb_server.IXLan",
                    ),
                ),
            ],
            options={
                "abstract": False,
                "db_table": "peeringdb_ixlan_prefix",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name="Network",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "status",
                    models.CharField(blank=True, max_length=255, verbose_name="Status"),
                ),
                (
                    "created",
                    django_handleref.models.CreatedDateTimeField(
                        auto_now_add=True, verbose_name="Created"
                    ),
                ),
                (
                    "updated",
                    django_handleref.models.UpdatedDateTimeField(
                        auto_now=True, verbose_name="Updated"
                    ),
                ),
                ("version", models.IntegerField(default=0)),
                ("asn", django_inet.models.ASNField(unique=True)),
                ("name", models.CharField(max_length=255, unique=True)),
                ("aka", models.CharField(blank=True, max_length=255)),
                ("irr_as_set", models.CharField(blank=True, max_length=255)),
                (
                    "website",
                    django_peeringdb.models.abstract.URLField(
                        blank=True, max_length=255
                    ),
                ),
                (
                    "looking_glass",
                    django_peeringdb.models.abstract.URLField(
                        blank=True, max_length=255
                    ),
                ),
                (
                    "route_server",
                    django_peeringdb.models.abstract.URLField(
                        blank=True, max_length=255
                    ),
                ),
                ("notes", models.TextField(blank=True)),
                ("notes_private", models.TextField(blank=True)),
                (
                    "info_traffic",
                    models.CharField(
                        blank=True,
                        choices=[
                            (b"", b"Not Disclosed"),
                            (b"0-20 Mbps", b"0-20 Mbps"),
                            (b"20-100Mbps", b"20-100Mbps"),
                            (b"100-1000Mbps", b"100-1000Mbps"),
                            (b"1-5Gbps", b"1-5Gbps"),
                            (b"5-10Gbps", b"5-10Gbps"),
                            (b"10-20Gbps", b"10-20Gbps"),
                            (b"20-50 Gbps", b"20-50 Gbps"),
                            (b"50-100 Gbps", b"50-100 Gbps"),
                            (b"100+ Gbps", b"100+ Gbps"),
                            (b"100-200 Gbps", b"100-200 Gbps"),
                            (b"200-300 Gbps", b"200-300 Gbps"),
                            (b"300-500 Gbps", b"300-500 Gbps"),
                            (b"500-1000 Gbps", b"500-1000 Gbps"),
                            (b"1 Tbps+", b"1 Tbps+"),
                            (b"10 Tbps+", b"10 Tbps+"),
                        ],
                        max_length=39,
                    ),
                ),
                (
                    "info_ratio",
                    models.CharField(
                        blank=True,
                        choices=[
                            (b"", b"Not Disclosed"),
                            (b"Not Disclosed", b"Not Disclosed"),
                            (b"Heavy Outbound", b"Heavy Outbound"),
                            (b"Mostly Outbound", b"Mostly Outbound"),
                            (b"Balanced", b"Balanced"),
                            (b"Mostly Inbound", b"Mostly Inbound"),
                            (b"Heavy Inbound", b"Heavy Inbound"),
                        ],
                        default=b"Not Disclosed",
                        max_length=45,
                    ),
                ),
                (
                    "info_scope",
                    models.CharField(
                        blank=True,
                        choices=[
                            (b"", b"Not Disclosed"),
                            (b"Not Disclosed", b"Not Disclosed"),
                            (b"Regional", b"Regional"),
                            (b"North America", b"North America"),
                            (b"Asia Pacific", b"Asia Pacific"),
                            (b"Europe", b"Europe"),
                            (b"South America", b"South America"),
                            (b"Africa", b"Africa"),
                            (b"Australia", b"Australia"),
                            (b"Middle East", b"Middle East"),
                            (b"Global", b"Global"),
                        ],
                        default=b"Not Disclosed",
                        max_length=39,
                    ),
                ),
                (
                    "info_type",
                    models.CharField(
                        blank=True,
                        choices=[
                            (b"", b"Not Disclosed"),
                            (b"Not Disclosed", b"Not Disclosed"),
                            (b"NSP", b"NSP"),
                            (b"Content", b"Content"),
                            (b"Cable/DSL/ISP", b"Cable/DSL/ISP"),
                            (b"Enterprise", b"Enterprise"),
                            (b"Educational/Research", b"Educational/Research"),
                            (b"Non-Profit", b"Non-Profit"),
                            (b"Route Server", b"Route Server"),
                        ],
                        default=b"Not Disclosed",
                        max_length=60,
                    ),
                ),
                ("info_prefixes4", models.PositiveIntegerField(blank=True, null=True)),
                ("info_prefixes6", models.PositiveIntegerField(blank=True, null=True)),
                ("info_unicast", models.BooleanField(default=False)),
                ("info_multicast", models.BooleanField(default=False)),
                ("info_ipv6", models.BooleanField(default=False)),
                (
                    "policy_url",
                    django_peeringdb.models.abstract.URLField(
                        blank=True, max_length=255
                    ),
                ),
                (
                    "policy_general",
                    models.CharField(
                        blank=True,
                        choices=[
                            (b"Open", b"Open"),
                            (b"Selective", b"Selective"),
                            (b"Restrictive", b"Restrictive"),
                            (b"No", b"No"),
                        ],
                        max_length=72,
                    ),
                ),
                (
                    "policy_locations",
                    models.CharField(
                        blank=True,
                        choices=[
                            (b"Not Required", b"Not Required"),
                            (b"Preferred", b"Preferred"),
                            (b"Required - US", b"Required - US"),
                            (b"Required - EU", b"Required - EU"),
                            (b"Required - International", b"Required - International"),
                        ],
                        max_length=72,
                    ),
                ),
                ("policy_ratio", models.BooleanField(default=False)),
                (
                    "policy_contracts",
                    models.CharField(
                        blank=True,
                        choices=[
                            (b"Not Required", b"Not Required"),
                            (b"Private Only", b"Private Only"),
                            (b"Required", b"Required"),
                        ],
                        max_length=36,
                    ),
                ),
            ],
            options={
                "abstract": False,
                "db_table": "peeringdb_network",
                "verbose_name_plural": "Networks",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name="NetworkContact",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "status",
                    models.CharField(blank=True, max_length=255, verbose_name="Status"),
                ),
                (
                    "created",
                    django_handleref.models.CreatedDateTimeField(
                        auto_now_add=True, verbose_name="Created"
                    ),
                ),
                (
                    "updated",
                    django_handleref.models.UpdatedDateTimeField(
                        auto_now=True, verbose_name="Updated"
                    ),
                ),
                ("version", models.IntegerField(default=0)),
                (
                    "role",
                    models.CharField(
                        choices=[
                            (b"Abuse", b"Abuse"),
                            (b"Maintenance", b"Maintenance"),
                            (b"Policy", b"Policy"),
                            (b"Technical", b"Technical"),
                            (b"NOC", b"NOC"),
                            (b"Public Relations", b"Public Relations"),
                            (b"Sales", b"Sales"),
                        ],
                        max_length=27,
                    ),
                ),
                (
                    "visible",
                    models.CharField(
                        choices=[
                            (b"Private", b"Private"),
                            (b"Users", b"Users"),
                            (b"Public", b"Public"),
                        ],
                        default=b"Public",
                        max_length=64,
                    ),
                ),
                ("name", models.CharField(blank=True, max_length=254)),
                ("phone", models.CharField(blank=True, max_length=100)),
                ("email", models.EmailField(blank=True, max_length=254)),
                (
                    "url",
                    django_peeringdb.models.abstract.URLField(
                        blank=True, max_length=255
                    ),
                ),
                (
                    "network",
                    models.ForeignKey(
                        default=0,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="poc_set",
                        to="peeringdb_server.Network",
                    ),
                ),
            ],
            options={
                "db_table": "peeringdb_network_contact",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name="NetworkFacility",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "status",
                    models.CharField(blank=True, max_length=255, verbose_name="Status"),
                ),
                (
                    "created",
                    django_handleref.models.CreatedDateTimeField(
                        auto_now_add=True, verbose_name="Created"
                    ),
                ),
                (
                    "updated",
                    django_handleref.models.UpdatedDateTimeField(
                        auto_now=True, verbose_name="Updated"
                    ),
                ),
                ("version", models.IntegerField(default=0)),
                ("local_asn", django_inet.models.ASNField(blank=True, null=True)),
                ("avail_sonet", models.BooleanField(default=False)),
                ("avail_ethernet", models.BooleanField(default=False)),
                ("avail_atm", models.BooleanField(default=False)),
                (
                    "facility",
                    models.ForeignKey(
                        default=0,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="netfac_set",
                        to="peeringdb_server.Facility",
                    ),
                ),
                (
                    "network",
                    models.ForeignKey(
                        default=0,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="netfac_set",
                        to="peeringdb_server.Network",
                    ),
                ),
            ],
            options={
                "db_table": "peeringdb_network_facility",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name="NetworkIXLan",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "status",
                    models.CharField(blank=True, max_length=255, verbose_name="Status"),
                ),
                (
                    "created",
                    django_handleref.models.CreatedDateTimeField(
                        auto_now_add=True, verbose_name="Created"
                    ),
                ),
                (
                    "updated",
                    django_handleref.models.UpdatedDateTimeField(
                        auto_now=True, verbose_name="Updated"
                    ),
                ),
                ("version", models.IntegerField(default=0)),
                ("asn", django_inet.models.ASNField()),
                (
                    "ipaddr4",
                    django_inet.models.IPAddressField(
                        blank=True, max_length=39, null=True
                    ),
                ),
                (
                    "ipaddr6",
                    django_inet.models.IPAddressField(
                        blank=True, max_length=39, null=True
                    ),
                ),
                ("is_rs_peer", models.BooleanField(default=False)),
                ("notes", models.CharField(blank=True, max_length=255)),
                ("speed", models.PositiveIntegerField()),
                (
                    "ixlan",
                    models.ForeignKey(
                        default=0,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="netixlan_set",
                        to="peeringdb_server.IXLan",
                    ),
                ),
                (
                    "network",
                    models.ForeignKey(
                        default=0,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="netixlan_set",
                        to="peeringdb_server.Network",
                    ),
                ),
            ],
            options={
                "db_table": "peeringdb_network_ixlan",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name="Organization",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "status",
                    models.CharField(blank=True, max_length=255, verbose_name="Status"),
                ),
                (
                    "created",
                    django_handleref.models.CreatedDateTimeField(
                        auto_now_add=True, verbose_name="Created"
                    ),
                ),
                (
                    "updated",
                    django_handleref.models.UpdatedDateTimeField(
                        auto_now=True, verbose_name="Updated"
                    ),
                ),
                ("version", models.IntegerField(default=0)),
                ("address1", models.CharField(blank=True, max_length=255)),
                ("address2", models.CharField(blank=True, max_length=255)),
                ("city", models.CharField(blank=True, max_length=255)),
                ("state", models.CharField(blank=True, max_length=255)),
                ("zipcode", models.CharField(blank=True, max_length=48)),
                (
                    "country",
                    django_countries.fields.CountryField(blank=True, max_length=2),
                ),
                ("name", models.CharField(max_length=255, unique=True)),
                (
                    "website",
                    django_peeringdb.models.abstract.URLField(
                        blank=True, max_length=255
                    ),
                ),
                ("notes", models.TextField(blank=True)),
                (
                    "logo",
                    models.FileField(
                        blank=True,
                        help_text=b"Allows you to upload and set a logo image file for this organization",
                        null=True,
                        upload_to=b"logos/",
                    ),
                ),
            ],
            options={
                "abstract": False,
                "db_table": "peeringdb_organization",
                "verbose_name_plural": "Organizations",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name="OrganizationMerge",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(auto_now_add=True, verbose_name="Merged on"),
                ),
                (
                    "from_org",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="merged_to",
                        to="peeringdb_server.Organization",
                    ),
                ),
                (
                    "to_org",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="merged_from",
                        to="peeringdb_server.Organization",
                    ),
                ),
            ],
            options={
                "db_table": "peeringdb_organization_merge",
                "verbose_name": "Organization Merge",
                "verbose_name_plural": "Organization Merges",
            },
        ),
        migrations.CreateModel(
            name="OrganizationMergeEntity",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("object_id", models.PositiveIntegerField()),
                ("note", models.CharField(blank=True, max_length=32, null=True)),
                (
                    "content_type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="contenttypes.ContentType",
                    ),
                ),
                (
                    "merge",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="entities",
                        to="peeringdb_server.OrganizationMerge",
                    ),
                ),
            ],
            options={
                "db_table": "peeringdb_organization_merge_entity",
                "verbose_name": "Organization Merge: Entity",
                "verbose_name_plural": "Organization Merge: Entities",
            },
        ),
        migrations.CreateModel(
            name="Sponsorship",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "start_date",
                    models.DateTimeField(
                        default=peeringdb_server.models.default_time_s,
                        verbose_name="Sponsorship starts on",
                    ),
                ),
                (
                    "end_date",
                    models.DateTimeField(
                        default=peeringdb_server.models.default_time_e,
                        verbose_name="Sponsorship ends on",
                    ),
                ),
                (
                    "notify_date",
                    models.DateTimeField(
                        blank=True,
                        null=True,
                        verbose_name="Expiration notification sent on",
                    ),
                ),
                (
                    "level",
                    models.PositiveIntegerField(
                        choices=[
                            (1, "Silver"),
                            (2, "Gold"),
                            (3, "Platinum"),
                            (4, "Diamond"),
                        ],
                        default=1,
                    ),
                ),
                (
                    "url",
                    models.URLField(
                        blank=True,
                        help_text="If specified clicking the sponsorship will take the user to this location",
                        null=True,
                        verbose_name="URL",
                    ),
                ),
                (
                    "logo",
                    models.FileField(
                        blank=True,
                        help_text=b"Allows you to upload and set a logo image file for this sponsorship",
                        null=True,
                        upload_to=b"logos/",
                    ),
                ),
                (
                    "org",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="sponsorships",
                        to="peeringdb_server.Organization",
                    ),
                ),
            ],
            options={
                "db_table": "peeringdb_sponsorship",
                "verbose_name": "Sponsorship",
                "verbose_name_plural": "Sponsorships",
            },
        ),
        migrations.CreateModel(
            name="UserOrgAffiliationRequest",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "org_name",
                    models.CharField(
                        blank=True,
                        help_text=b"The organization name entered by the user",
                        max_length=255,
                        null=True,
                    ),
                ),
                (
                    "asn",
                    django_inet.models.ASNField(
                        blank=True, help_text=b"The ASN entered by the user", null=True
                    ),
                ),
                (
                    "created",
                    django_handleref.models.CreatedDateTimeField(
                        auto_now_add=True, verbose_name="Created"
                    ),
                ),
                (
                    "status",
                    models.CharField(
                        choices=[
                            (b"pending", b"Pending"),
                            (b"approved", b"Approved"),
                            (b"denied", b"Denied"),
                        ],
                        help_text=b"Status of this request",
                        max_length=254,
                    ),
                ),
                (
                    "org",
                    models.ForeignKey(
                        blank=True,
                        help_text=b"This organization in our database that was derived from the provided ASN or organization name. If this is empty it means no matching organization was found.",
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="affiliation_requests",
                        to="peeringdb_server.Organization",
                    ),
                ),
            ],
            options={
                "db_table": "peeringdb_user_org_affil_request",
            },
        ),
        migrations.CreateModel(
            name="VerificationQueueItem",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("object_id", models.PositiveIntegerField()),
                (
                    "created",
                    django_handleref.models.CreatedDateTimeField(
                        auto_now_add=True, verbose_name="Created"
                    ),
                ),
                ("notified", models.BooleanField(default=False)),
                (
                    "content_type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="contenttypes.ContentType",
                    ),
                ),
            ],
            options={
                "db_table": "peeringdb_verification_queue",
            },
        ),
        migrations.CreateModel(
            name="UserPasswordReset",
            fields=[
                (
                    "user",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        primary_key=True,
                        related_name="password_reset",
                        serialize=False,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                ("token", models.CharField(max_length=255)),
                ("created", models.DateTimeField(auto_now_add=True)),
            ],
            options={
                "db_table": "peeringdb_user_password_reset",
            },
        ),
        migrations.AddField(
            model_name="verificationqueueitem",
            name="user",
            field=models.ForeignKey(
                blank=True,
                help_text=b"The item that this queue is attached to was created by this user",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="vqitems",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AddField(
            model_name="userorgaffiliationrequest",
            name="user",
            field=models.ForeignKey(
                help_text=b"The user that made the request",
                on_delete=django.db.models.deletion.CASCADE,
                related_name="affiliation_requests",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AddField(
            model_name="network",
            name="org",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="net_set",
                to="peeringdb_server.Organization",
            ),
        ),
        migrations.AddField(
            model_name="internetexchange",
            name="org",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="ix_set",
                to="peeringdb_server.Organization",
            ),
        ),
        migrations.AddField(
            model_name="facility",
            name="org",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="fac_set",
                to="peeringdb_server.Organization",
            ),
        ),
        migrations.AddField(
            model_name="user",
            name="groups",
            field=models.ManyToManyField(
                blank=True,
                help_text="The groups this user belongs to. A user will get all permissions granted to each of their groups.",
                related_name="user_set",
                related_query_name="user",
                to="auth.Group",
                verbose_name="groups",
            ),
        ),
        migrations.AddField(
            model_name="user",
            name="user_permissions",
            field=models.ManyToManyField(
                blank=True,
                help_text="Specific permissions for this user.",
                related_name="user_set",
                related_query_name="user",
                to="auth.Permission",
                verbose_name="user permissions",
            ),
        ),
        migrations.CreateModel(
            name="DuplicateIPNetworkIXLan",
            fields=[],
            options={
                "verbose_name": "Duplicate IP",
                "proxy": True,
                "verbose_name_plural": "Duplicate IPs",
                "indexes": [],
            },
            bases=("peeringdb_server.networkixlan",),
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name="UserPermission",
            fields=[],
            options={
                "verbose_name": "User Permission",
                "proxy": True,
                "verbose_name_plural": "User Permissions",
                "indexes": [],
            },
            bases=("peeringdb_server.user",),
            managers=[
                ("objects", django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.AlterUniqueTogether(
            name="networkfacility",
            unique_together={("network", "facility", "local_asn")},
        ),
        migrations.AlterUniqueTogether(
            name="internetexchangefacility",
            unique_together={("ix", "facility")},
        ),
    ]
