Exemplo n.º 1
0
class Migration(migrations.Migration):

    dependencies = [
        ("contenttypes", "0002_remove_content_type_name"),
        ("django_fullctl", "0008_managementtask"),
    ]

    operations = [
        migrations.CreateModel(
            name="TaskClaim",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                ("task_id", models.PositiveIntegerField()),
                ("worker_id", models.CharField(max_length=255)),
                (
                    "task_type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="contenttypes.contenttype",
                    ),
                ),
            ],
            options={
                "verbose_name": "Claimed Task",
                "verbose_name_plural": "Claimed Tasks",
                "db_table": "fullctl_task_claim",
                "unique_together": {("task_type", "task_id")},
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
    ]
Exemplo n.º 2
0
class Migration(migrations.Migration):

    dependencies = [
        ("account", "0017_managedpermission"),
    ]

    operations = [
        migrations.CreateModel(
            name="OrganizationAPIKey",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                ("name", models.CharField(blank=True,
                                          max_length=255,
                                          null=True)),
                (
                    "key",
                    models.CharField(
                        default=account.models.generate_api_key,
                        max_length=255,
                        unique=True,
                    ),
                ),
                (
                    "managed",
                    models.BooleanField(
                        default=True,
                        help_text="Is the API Key managed by the owner"),
                ),
                ("email", models.EmailField(max_length=254)),
                (
                    "org",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="orgkey_set",
                        to="account.Organization",
                    ),
                ),
            ],
            options={
                "verbose_name": "Organization API Key",
                "verbose_name_plural": "Organization API Keys",
                "db_table": "account_org_api_key",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.AlterModelOptions(
            name="managedpermission",
            options={
                "verbose_name": "Managed permission",
                "verbose_name_plural": "Managed permissions",
            },
        ),
        migrations.AlterModelManagers(
            name="apikey",
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.AddField(
            model_name="apikey",
            name="name",
            field=models.CharField(blank=True, max_length=255, null=True),
        ),
        migrations.AddField(
            model_name="apikey",
            name="readonly",
            field=models.BooleanField(default=False),
        ),
        migrations.AlterField(
            model_name="apikey",
            name="managed",
            field=models.BooleanField(
                default=True, help_text="Is the API Key managed by the owner"),
        ),
        migrations.CreateModel(
            name="OrganizationAPIKeyPermission",
            fields=[
                (
                    "namespace",
                    models.CharField(
                        help_text=
                        "Permission namespace (A '.' delimited list of keys",
                        max_length=255,
                    ),
                ),
                ("permission",
                 django_grainy.fields.PermissionField(default=1)),
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                (
                    "api_key",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="grainy_permissions",
                        to="account.OrganizationAPIKey",
                    ),
                ),
            ],
            options={
                "verbose_name": "Organization API Key Permission",
                "verbose_name_plural": "Organization API Key Permissions",
                "db_table": "account_org_api_key_permission",
            },
        ),
    ]
Exemplo n.º 3
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("account", "0009_auto_20200323_1425"),
    ]

    operations = [
        migrations.CreateModel(
            name="Invitation",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                (
                    "secret",
                    models.CharField(
                        default=account.models.generate_invite_secret, max_length=255
                    ),
                ),
                ("email", models.EmailField(max_length=254)),
                (
                    "created_by",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="inv_set",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "org",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="inv_set",
                        to="account.Organization",
                    ),
                ),
            ],
            options={
                "verbose_name": "Invitation",
                "verbose_name_plural": "Invitations",
                "db_table": "account_invitation",
            },
            managers=[("handleref", django.db.models.manager.Manager())],
        )
    ]
Exemplo n.º 4
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [("account", "0012_auto_20200324_1357")]

    operations = [
        migrations.CreateModel(
            name="BillingContact",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                ("name", models.CharField(max_length=255)),
                ("email",
                 models.EmailField(blank=True, max_length=255, null=True)),
                (
                    "org",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="billcon_set",
                        to="account.Organization",
                    ),
                ),
            ],
            options={
                "verbose_name": "Billing Contact",
                "verbose_name_plural": "Billing Contacts",
                "db_table": "billing_contact",
            },
            managers=[("handleref", django.db.models.manager.Manager())],
        ),
        migrations.CreateModel(
            name="OrderHistory",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                (
                    "billed_to",
                    models.CharField(
                        help_text=
                        "Holds the name of the payment method that was billled for archiving purposes.",
                        max_length=255,
                    ),
                ),
                (
                    "notes",
                    models.CharField(
                        blank=True,
                        help_text="Order specific notes",
                        max_length=255,
                        null=True,
                    ),
                ),
                (
                    "processed",
                    models.DateTimeField(
                        help_text="When was this order processed"),
                ),
                (
                    "order_id",
                    models.CharField(
                        default=billing.models.unique_order_history_id,
                        max_length=16,
                        unique=True,
                    ),
                ),
                (
                    "billcon",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="order_set",
                        to="billing.BillingContact",
                    ),
                ),
            ],
            options={
                "verbose_name": "Order History Entry",
                "verbose_name_plural": "Order History Entries",
                "db_table": "billing_order_history",
            },
            managers=[("handleref", django.db.models.manager.Manager())],
        ),
        migrations.CreateModel(
            name="PaymentCharge",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                (
                    "price",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        help_text="Price attributed to cycle for this product",
                        max_digits=6,
                    ),
                ),
                (
                    "description",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                (
                    "data",
                    django.contrib.postgres.fields.jsonb.JSONField(
                        blank=True, default=dict, help_text="Any extra data"),
                ),
            ],
            options={
                "verbose_name": "Payment Charge",
                "verbose_name_plural": "Payment Charges",
                "db_table": "billing_charge",
            },
            managers=[("handleref", django.db.models.manager.Manager())],
        ),
        migrations.CreateModel(
            name="PaymentMethod",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                (
                    "custom_name",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                ("processor", models.CharField(max_length=255)),
                (
                    "data",
                    django.contrib.postgres.fields.jsonb.JSONField(
                        blank=True, default=dict),
                ),
                ("holder", models.CharField(max_length=255)),
                ("country",
                 django_countries.fields.CountryField(max_length=2)),
                ("city", models.CharField(max_length=255)),
                ("address1", models.CharField(max_length=255)),
                ("address2",
                 models.CharField(blank=True, max_length=255, null=True)),
                ("postal_code", models.CharField(max_length=255)),
                ("state",
                 models.CharField(blank=True, max_length=255, null=True)),
                (
                    "billcon",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="pay_set",
                        to="billing.BillingContact",
                    ),
                ),
            ],
            options={
                "verbose_name": "Payment Method",
                "verbose_name_plural": "Payment Methods",
                "db_table": "billing_payment_method",
            },
            managers=[("handleref", django.db.models.manager.Manager())],
        ),
        migrations.CreateModel(
            name="Product",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                (
                    "name",
                    models.CharField(help_text="Internal product name",
                                     max_length=255,
                                     unique=True),
                ),
                (
                    "component",
                    models.CharField(help_text="Product belongs to component",
                                     max_length=255),
                ),
                (
                    "description",
                    models.CharField(
                        help_text=
                        "Description of the product or service being billed",
                        max_length=255,
                    ),
                ),
                (
                    "price",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        help_text=
                        "Price charge on initial setup / purchase. For recurring pricing this could specify a setup fee. For non-recurring pricing, this is the product price.",
                        max_digits=6,
                    ),
                ),
                (
                    "data",
                    django.contrib.postgres.fields.jsonb.JSONField(
                        blank=True,
                        default=dict,
                        help_text=
                        "Arbitrary extra data you want to define for this product",
                    ),
                ),
            ],
            options={
                "verbose_name": "Product",
                "verbose_name_plural": "Products",
                "db_table": "billing_product",
            },
            managers=[("handleref", django.db.models.manager.Manager())],
        ),
        migrations.CreateModel(
            name="ProductGroup",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                ("name", models.CharField(max_length=255)),
                ("subscription_cycle_anchor",
                 models.DateField(blank=True, null=True)),
            ],
            options={
                "verbose_name": "Product Group",
                "verbose_name_plural": "Product Groups",
                "db_table": "billing_product_group",
            },
            managers=[("handleref", django.db.models.manager.Manager())],
        ),
        migrations.CreateModel(
            name="Subscription",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                (
                    "cycle_interval",
                    models.CharField(
                        choices=[("month", "Monthly"), ("year", "Yearly")],
                        default="month",
                        max_length=255,
                    ),
                ),
                (
                    "cycle_start",
                    models.DateTimeField(blank=True,
                                         help_text="Start of billing cycle",
                                         null=True),
                ),
                ("cycle_frequency", models.PositiveIntegerField(default=1)),
                (
                    "data",
                    django.contrib.postgres.fields.jsonb.JSONField(
                        blank=True,
                        default=dict,
                        help_text="Any extra data for the subscription",
                    ),
                ),
                (
                    "group",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="sub_set",
                        to="billing.ProductGroup",
                    ),
                ),
                (
                    "org",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="sub_set",
                        to="account.Organization",
                    ),
                ),
                (
                    "pay",
                    models.ForeignKey(
                        help_text=
                        "User payment option that will be charged by this sub",
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="sub_set",
                        to="billing.PaymentMethod",
                    ),
                ),
            ],
            options={
                "verbose_name": "Subscription",
                "verbose_name_plural": "Subscriptions",
                "db_table": "billing_subscription",
            },
            managers=[("handleref", django.db.models.manager.Manager())],
        ),
        migrations.CreateModel(
            name="SubscriptionCycle",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                ("start", models.DateField()),
                ("end", models.DateField()),
                (
                    "sub",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="cycle_set",
                        to="billing.Subscription",
                    ),
                ),
            ],
            options={
                "verbose_name": "Subscription Cycle",
                "verbose_name_plural": "Subscription Cycles",
                "db_table": "billing_subscription_cycle",
            },
            managers=[("handleref", django.db.models.manager.Manager())],
        ),
        migrations.CreateModel(
            name="SubscriptionProduct",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                (
                    "data",
                    django.contrib.postgres.fields.jsonb.JSONField(
                        blank=True,
                        default=dict,
                        help_text="Any extra data for the subscription item",
                    ),
                ),
                (
                    "prod",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="sub_set",
                        to="billing.Product",
                    ),
                ),
                (
                    "sub",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="subprod_set",
                        to="billing.Subscription",
                    ),
                ),
            ],
            options={
                "verbose_name": "Subscription Product",
                "verbose_name_plural": "Subscription Products",
                "db_table": "billing_subscription_product",
            },
            managers=[("handleref", django.db.models.manager.Manager())],
        ),
        migrations.CreateModel(
            name="SubscriptionModifier",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                (
                    "type",
                    models.CharField(
                        choices=[
                            ("reduction", "Price Reduction"),
                            ("quantity", "Free Quantity"),
                        ],
                        max_length=255,
                    ),
                ),
                ("value", models.IntegerField(default=0)),
                ("valid", models.DateTimeField(help_text="Valid until")),
                (
                    "source",
                    models.CharField(
                        help_text="source of modifier, why was it applied",
                        max_length=255,
                    ),
                ),
                (
                    "sub",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="modifier_set_set",
                        to="billing.Subscription",
                    ),
                ),
            ],
            options={
                "verbose_name": "Subscription Price Modifier",
                "verbose_name_plural": "Subscription Price Modifiers",
                "db_table": "billing_subscription_modifier",
            },
            managers=[("handleref", django.db.models.manager.Manager())],
        ),
        migrations.CreateModel(
            name="SubscriptionCycleProduct",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                (
                    "usage",
                    models.PositiveIntegerField(
                        default=0,
                        help_text="Usage attributed to cycle for this product",
                    ),
                ),
                (
                    "cycle",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="cycleprod_set",
                        to="billing.SubscriptionCycle",
                    ),
                ),
                (
                    "subprod",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="cycleprod_set",
                        to="billing.SubscriptionProduct",
                    ),
                ),
            ],
            options={
                "verbose_name": "Subscription Cycle Product",
                "verbose_name_plural": "Subscription Cycle Product",
                "db_table": "billing_subscription_cycle_product",
            },
            managers=[("handleref", django.db.models.manager.Manager())],
        ),
        migrations.CreateModel(
            name="SubscriptionCycleCharge",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                (
                    "chg",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="cyclechg",
                        to="billing.PaymentCharge",
                    ),
                ),
                (
                    "cycle",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="cyclechg_set",
                        to="billing.SubscriptionCycle",
                    ),
                ),
            ],
            options={
                "verbose_name": "Subscription Cycle Charge",
                "verbose_name_plural": "Subscription Cycle Charges",
                "db_table": "billing_subscription_cycle_charge",
            },
            managers=[("handleref", django.db.models.manager.Manager())],
        ),
        migrations.CreateModel(
            name="RecurringProduct",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                (
                    "type",
                    models.CharField(
                        choices=[
                            ("fixed", "Recurring: Fixed Price"),
                            ("metered", "Recurring: Metered Price"),
                        ],
                        default=None,
                        max_length=255,
                        null=True,
                    ),
                ),
                (
                    "price",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        help_text=
                        "Price in the context of recurring charges. For fixed recurring pricing this would be the price charged each cycle. For metered recurring pricing this could be the price as it relates to the metered value.",
                        max_digits=6,
                    ),
                ),
                (
                    "unit",
                    models.CharField(
                        default="Unit",
                        help_text="Label for a unit in the context of usage",
                        max_length=32,
                    ),
                ),
                (
                    "unit_plural",
                    models.CharField(
                        default="Units",
                        help_text=
                        "Label for multiple units in the context of usage",
                        max_length=40,
                    ),
                ),
                (
                    "metered_url",
                    models.URLField(
                        blank=True,
                        help_text=
                        "For metered charges, specify the url that is used to retrieve the current metered value",
                        null=True,
                    ),
                ),
                (
                    "data",
                    django.contrib.postgres.fields.jsonb.JSONField(
                        blank=True,
                        default=dict,
                        help_text=
                        "Arbitrary extra data you want to define for this recurring product",
                    ),
                ),
                (
                    "prod",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="recurring",
                        to="billing.Product",
                    ),
                ),
            ],
            options={
                "verbose_name": "Recurring Product Settings",
                "verbose_name_plural": "Recurring Product Settings",
                "db_table": "billing_recurring_product",
            },
            managers=[("handleref", django.db.models.manager.Manager())],
        ),
        migrations.CreateModel(
            name="ProductModifier",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                (
                    "type",
                    models.CharField(
                        choices=[
                            ("reduction", "Price Reduction"),
                            ("quantity", "Free Quantity"),
                        ],
                        max_length=255,
                    ),
                ),
                ("value", models.PositiveIntegerField(default=0)),
                (
                    "duration",
                    models.IntegerField(default=0,
                                        help_text="Duration in days"),
                ),
                (
                    "code",
                    models.CharField(
                        blank=True,
                        help_text="activation code",
                        max_length=255,
                        null=True,
                    ),
                ),
                (
                    "prod",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="modifier_set",
                        to="billing.Product",
                    ),
                ),
            ],
            options={
                "verbose_name": "Product Price Modifier",
                "verbose_name_plural": "Product Price Modifiers",
                "db_table": "billing_product_modifier",
            },
            managers=[("handleref", django.db.models.manager.Manager())],
        ),
        migrations.AddField(
            model_name="product",
            name="group",
            field=models.ForeignKey(
                blank=True,
                help_text=
                "Allows you to group products together for billing purposes",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="prod_set",
                to="billing.ProductGroup",
            ),
        ),
        migrations.AddField(
            model_name="paymentcharge",
            name="pay",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="chg_set",
                to="billing.PaymentMethod",
            ),
        ),
        migrations.CreateModel(
            name="OrderHistoryItem",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                ("description", models.CharField(max_length=255)),
                (
                    "price",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        help_text="Price charged",
                        max_digits=6,
                    ),
                ),
                (
                    "cycleprod",
                    models.OneToOneField(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="orderitem",
                        to="billing.SubscriptionCycleProduct",
                    ),
                ),
                (
                    "order",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="orderitem_set",
                        to="billing.OrderHistory",
                    ),
                ),
            ],
            options={
                "verbose_name": "Order History Item",
                "verbose_name_plural": "Order History Items",
                "db_table": "billing_order_history_item",
            },
            managers=[("handleref", django.db.models.manager.Manager())],
        ),
        migrations.AddField(
            model_name="orderhistory",
            name="chg",
            field=models.OneToOneField(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="order",
                to="billing.PaymentCharge",
            ),
        ),
        migrations.CreateModel(
            name="CustomerData",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                (
                    "data",
                    django.contrib.postgres.fields.jsonb.JSONField(
                        blank=True, default=dict),
                ),
                (
                    "billcon",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="customer",
                        to="billing.BillingContact",
                    ),
                ),
            ],
            options={
                "verbose_name": "Customer Data",
                "verbose_name_plural": "Customer Data",
                "db_table": "billing_customer_data",
            },
            managers=[("handleref", django.db.models.manager.Manager())],
        ),
    ]
Exemplo n.º 5
0
class Migration(migrations.Migration):

    dependencies = [
        ("contenttypes", "0002_remove_content_type_name"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("billing", "0005_auto_20210127_1631"),
    ]

    operations = [
        migrations.AlterField(
            model_name="orderhistory",
            name="order_id",
            field=models.CharField(
                default=billing.models.unique_order_history_id,
                max_length=16,
                unique=True,
            ),
        ),
        migrations.CreateModel(
            name="Withdrawal",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "updated",
                    django_handleref.models.UpdatedDateTimeField(
                        auto_now=True, verbose_name="Updated"),
                ),
                ("version", models.IntegerField(default=0)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        default=django.utils.timezone.now,
                        help_text="When transaction was created.",
                    ),
                ),
                (
                    "currency",
                    models.CharField(choices=[("USD", "USD")],
                                     default="USD",
                                     max_length=255),
                ),
                ("amount", models.DecimalField(decimal_places=2,
                                               max_digits=8)),
                (
                    "transaction_id",
                    models.UUIDField(default=uuid.uuid4, editable=False),
                ),
                (
                    "payment_processor_txn_id",
                    models.CharField(blank=True, max_length=255),
                ),
                (
                    "billing_contact",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="withdrawal_money_transaction_set",
                        to="billing.BillingContact",
                    ),
                ),
                (
                    "payment_method",
                    models.ForeignKey(
                        help_text=
                        "User payment option that will be charged by this transaction",
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="withdrawal_payment_method",
                        to="billing.PaymentMethod",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="withdrawal_transaction_set",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "Withdrawal",
                "verbose_name_plural": "Withdrawals",
                "db_table": "billing_withdrawal",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name="Payment",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "updated",
                    django_handleref.models.UpdatedDateTimeField(
                        auto_now=True, verbose_name="Updated"),
                ),
                ("version", models.IntegerField(default=0)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        default=django.utils.timezone.now,
                        help_text="When transaction was created.",
                    ),
                ),
                (
                    "currency",
                    models.CharField(choices=[("USD", "USD")],
                                     default="USD",
                                     max_length=255),
                ),
                ("amount", models.DecimalField(decimal_places=2,
                                               max_digits=8)),
                (
                    "transaction_id",
                    models.UUIDField(default=uuid.uuid4, editable=False),
                ),
                (
                    "payment_processor_txn_id",
                    models.CharField(blank=True, max_length=255),
                ),
                ("invoice_number", models.CharField(blank=True,
                                                    max_length=255)),
                (
                    "billing_contact",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="payment_money_transaction_set",
                        to="billing.BillingContact",
                    ),
                ),
                (
                    "payment_method",
                    models.ForeignKey(
                        help_text=
                        "User payment option that will be charged by this transaction",
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="payment_payment_method",
                        to="billing.PaymentMethod",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="payment_transaction_set",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "Payment",
                "verbose_name_plural": "Payments",
                "db_table": "billing_payment",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name="Order",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "updated",
                    django_handleref.models.UpdatedDateTimeField(
                        auto_now=True, verbose_name="Updated"),
                ),
                ("version", models.IntegerField(default=0)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        default=django.utils.timezone.now,
                        help_text="When transaction was created.",
                    ),
                ),
                (
                    "currency",
                    models.CharField(choices=[("USD", "USD")],
                                     default="USD",
                                     max_length=255),
                ),
                ("amount", models.DecimalField(decimal_places=2,
                                               max_digits=8)),
                (
                    "transaction_id",
                    models.UUIDField(default=uuid.uuid4, editable=False),
                ),
                ("description", models.TextField(blank=True)),
                ("order_number", models.CharField(blank=True, max_length=255)),
                (
                    "product",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="order_set",
                        to="billing.Product",
                    ),
                ),
                (
                    "subscription",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="order_set",
                        to="billing.Subscription",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="order_transaction_set",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "Order",
                "verbose_name_plural": "Orders",
                "db_table": "billing_order",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name="Ledger",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("object_id", models.PositiveIntegerField()),
                (
                    "content_type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="contenttypes.ContentType",
                    ),
                ),
            ],
            options={
                "verbose_name": "Ledger",
                "verbose_name_plural": "Ledgers",
                "db_table": "billing_ledgers",
            },
        ),
        migrations.CreateModel(
            name="Invoice",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "updated",
                    django_handleref.models.UpdatedDateTimeField(
                        auto_now=True, verbose_name="Updated"),
                ),
                ("version", models.IntegerField(default=0)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        default=django.utils.timezone.now,
                        help_text="When transaction was created.",
                    ),
                ),
                (
                    "currency",
                    models.CharField(choices=[("USD", "USD")],
                                     default="USD",
                                     max_length=255),
                ),
                ("amount", models.DecimalField(decimal_places=2,
                                               max_digits=8)),
                (
                    "transaction_id",
                    models.UUIDField(default=uuid.uuid4, editable=False),
                ),
                ("description", models.TextField(blank=True)),
                ("invoice_number", models.CharField(blank=True,
                                                    max_length=255)),
                (
                    "product",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="invoice_set",
                        to="billing.Product",
                    ),
                ),
                (
                    "subscription",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="invoice_set",
                        to="billing.Subscription",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="invoice_transaction_set",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "Invoice",
                "verbose_name_plural": "Invoices",
                "db_table": "billing_invoice",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name="Deposit",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "updated",
                    django_handleref.models.UpdatedDateTimeField(
                        auto_now=True, verbose_name="Updated"),
                ),
                ("version", models.IntegerField(default=0)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        default=django.utils.timezone.now,
                        help_text="When transaction was created.",
                    ),
                ),
                (
                    "currency",
                    models.CharField(choices=[("USD", "USD")],
                                     default="USD",
                                     max_length=255),
                ),
                ("amount", models.DecimalField(decimal_places=2,
                                               max_digits=8)),
                (
                    "transaction_id",
                    models.UUIDField(default=uuid.uuid4, editable=False),
                ),
                (
                    "payment_processor_txn_id",
                    models.CharField(blank=True, max_length=255),
                ),
                (
                    "billing_contact",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="deposit_money_transaction_set",
                        to="billing.BillingContact",
                    ),
                ),
                (
                    "payment_method",
                    models.ForeignKey(
                        help_text=
                        "User payment option that will be charged by this transaction",
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="deposit_payment_method",
                        to="billing.PaymentMethod",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="deposit_transaction_set",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "Deposit",
                "verbose_name_plural": "Deposits",
                "db_table": "billing_deposit",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
    ]
Exemplo n.º 6
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("django_fullctl", "0001_initial"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="InternetExchange",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                ("version", models.IntegerField(default=0)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                ("pdb_id", models.PositiveIntegerField(blank=True, null=True)),
                ("pdb_version", models.PositiveIntegerField(blank=True, null=True)),
                ("name", models.CharField(max_length=255)),
                ("created", models.DateTimeField(auto_now_add=True)),
                ("updated", models.DateTimeField(auto_now=True)),
                (
                    "urlkey",
                    models.CharField(
                        default=django_ixctl.models.ixctl.generate_secret,
                        max_length=255,
                        unique=True,
                    ),
                ),
                (
                    "instance",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ix_set",
                        to="django_fullctl.Instance",
                    ),
                ),
            ],
            options={
                "verbose_name": "Internet Exchange",
                "verbose_name_plural": "Internet Exchanges",
                "db_table": "ixctl_ix",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name="Routeserver",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                (
                    "name",
                    models.CharField(help_text="Routeserver name", max_length=255),
                ),
                ("asn", django_inet.models.ASNField(help_text="ASN")),
                (
                    "router_id",
                    django_inet.models.IPAddressField(
                        help_text="Router Id", max_length=39
                    ),
                ),
                ("rpki_bgp_origin_validation", models.BooleanField(default=False)),
                (
                    "ars_type",
                    models.CharField(
                        choices=[
                            ("bird", "Bird"),
                            ("bird2", "Bird 2"),
                            ("openbgpd", "OpenBGPD"),
                        ],
                        default="bird",
                        max_length=32,
                    ),
                ),
                (
                    "max_as_path_length",
                    models.IntegerField(
                        default=32, help_text="Max length of AS_PATH attribute."
                    ),
                ),
                (
                    "no_export_action",
                    models.CharField(
                        choices=[
                            ("pass", "Pass (Treat as transitive)"),
                            ("strip", "Strip (Treat as non-transitive)"),
                        ],
                        default="pass",
                        help_text=(
                            "RFC1997 well-known communities (NO_EXPORT and NO_ADVERTISE)"
                        ),
                        max_length=8,
                    ),
                ),
                (
                    "graceful_shutdown",
                    models.BooleanField(
                        default=False, help_text="Graceful BGP session shutdown"
                    ),
                ),
                (
                    "extra_config",
                    models.TextField(
                        blank=True, help_text="Extra arouteserver config", null=True
                    ),
                ),
                (
                    "ix",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="rs_set",
                        to="django_ixctl.InternetExchange",
                    ),
                ),
            ],
            options={
                "db_table": "ixctl_rs",
                "unique_together": {("ix", "router_id")},
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name="RouteserverConfig",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                (
                    "generated",
                    models.DateTimeField(auto_now=True, help_text="Time of generation"),
                ),
                ("body", models.TextField(help_text="Config content")),
                (
                    "ars_general",
                    models.TextField(
                        blank=True, help_text="ARouteserver general config", null=True
                    ),
                ),
                (
                    "ars_clients",
                    models.TextField(
                        blank=True, help_text="ARouteserver clients config", null=True
                    ),
                ),
                (
                    "rs",
                    models.OneToOneField(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="django_ixctl.Routeserver",
                    ),
                ),
            ],
            options={
                "db_table": "ixctl_rsconf",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name="PermissionRequest",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                (
                    "type",
                    models.CharField(
                        choices=[("net_ix", "Manage network at exchange")],
                        max_length=255,
                    ),
                ),
                ("extra", models.TextField(blank=True, null=True)),
                (
                    "org",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="permreq_set",
                        to="django_fullctl.Organization",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="permreq_set",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "Permission Request",
                "verbose_name_plural": "Permission Requests",
                "db_table": "ixctl_permreq",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name="Network",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                ("pdb_id", models.PositiveIntegerField(blank=True, null=True)),
                ("pdb_version", models.PositiveIntegerField(blank=True, null=True)),
                ("name", models.CharField(max_length=255)),
                ("asn", models.IntegerField()),
                (
                    "instance",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="net_set",
                        to="django_fullctl.Instance",
                    ),
                ),
            ],
            options={
                "verbose_name": "Network",
                "verbose_name_plural": "Networks",
                "db_table": "ixctl_net",
                "unique_together": {("instance", "asn")},
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name="InternetExchangeMember",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                ("pdb_id", models.PositiveIntegerField(blank=True, null=True)),
                ("pdb_version", models.PositiveIntegerField(blank=True, null=True)),
                (
                    "ipaddr4",
                    models.CharField(
                        blank=True,
                        max_length=255,
                        null=True,
                        validators=[fullctl.django.inet.validators.validate_ip4],
                    ),
                ),
                (
                    "ipaddr6",
                    models.CharField(
                        blank=True,
                        max_length=255,
                        null=True,
                        validators=[fullctl.django.inet.validators.validate_ip6],
                    ),
                ),
                (
                    "macaddr",
                    django_inet.models.MacAddressField(
                        blank=True, max_length=17, null=True
                    ),
                ),
                (
                    "as_macro",
                    models.CharField(
                        blank=True,
                        max_length=255,
                        null=True,
                        validators=[fullctl.django.inet.validators.validate_as_set],
                    ),
                ),
                ("is_rs_peer", models.BooleanField(default=False)),
                ("speed", models.PositiveIntegerField()),
                ("asn", models.PositiveIntegerField()),
                ("name", models.CharField(blank=True, max_length=255, null=True)),
                ("ixf_state", models.CharField(default="active", max_length=255)),
                (
                    "ixf_member_type",
                    models.CharField(
                        choices=[
                            ("peering", "peering"),
                            ("ixp", "ixp"),
                            ("routeserver", "routeserver"),
                            ("probono", "probono"),
                        ],
                        default="peering",
                        max_length=255,
                    ),
                ),
                (
                    "ix",
                    models.ForeignKey(
                        help_text="Members at this Exchange",
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="member_set",
                        to="django_ixctl.InternetExchange",
                    ),
                ),
            ],
            options={
                "verbose_name": "Internet Exchange Member",
                "verbose_name_plural": "Internet Exchange Members",
                "db_table": "ixctl_member",
                "unique_together": {
                    ("macaddr", "ix"),
                    ("ipaddr4", "ix"),
                    ("ipaddr6", "ix"),
                },
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
    ]
Exemplo n.º 7
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        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),
                ),
                (
                    "latitude",
                    models.DecimalField(
                        blank=True,
                        decimal_places=6,
                        help_text="Latitude",
                        max_digits=9,
                        null=True,
                    ),
                ),
                (
                    "longitude",
                    models.DecimalField(
                        blank=True,
                        decimal_places=6,
                        help_text="Longitude",
                        max_digits=9,
                        null=True,
                    ),
                ),
                ("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=[
                            ("North America", "North America"),
                            ("Asia Pacific", "Asia Pacific"),
                            ("Europe", "Europe"),
                            ("South America", "South America"),
                            ("Africa", "Africa"),
                            ("Australia", "Australia"),
                            ("Middle East", "Middle East"),
                        ],
                        max_length=255,
                    ),
                ),
                (
                    "media",
                    models.CharField(
                        choices=[
                            ("Ethernet", "Ethernet"),
                            ("ATM", "ATM"),
                            ("Multiple", "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)),
                (
                    "fac",
                    models.ForeignKey(
                        default=0,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ixfac_set",
                        to="django_peeringdb.Facility",
                    ),
                ),
                (
                    "ix",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ixfac_set",
                        to="django_peeringdb.InternetExchange",
                    ),
                ),
            ],
            options={
                "db_table": "peeringdb_ix_facility",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name="IXLan",
            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(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="django_peeringdb.InternetExchange",
                    ),
                ),
            ],
            options={
                "abstract": False,
                "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=[("IPv4", "IPv4"),
                                              ("IPv6", "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="django_peeringdb.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=[
                            ("", "Not Disclosed"),
                            ("0-20 Mbps", "0-20 Mbps"),
                            ("20-100Mbps", "20-100Mbps"),
                            ("100-1000Mbps", "100-1000Mbps"),
                            ("1-5Gbps", "1-5Gbps"),
                            ("5-10Gbps", "5-10Gbps"),
                            ("10-20Gbps", "10-20Gbps"),
                            ("20-50 Gbps", "20-50 Gbps"),
                            ("50-100 Gbps", "50-100 Gbps"),
                            ("100+ Gbps", "100+ Gbps"),
                            ("100-200 Gbps", "100-200 Gbps"),
                            ("200-300 Gbps", "200-300 Gbps"),
                            ("300-500 Gbps", "300-500 Gbps"),
                            ("500-1000 Gbps", "500-1000 Gbps"),
                            ("1 Tbps+", "1 Tbps+"),
                            ("10 Tbps+", "10 Tbps+"),
                        ],
                        max_length=39,
                    ),
                ),
                (
                    "info_ratio",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("", "Not Disclosed"),
                            ("Not Disclosed", "Not Disclosed"),
                            ("Heavy Outbound", "Heavy Outbound"),
                            ("Mostly Outbound", "Mostly Outbound"),
                            ("Balanced", "Balanced"),
                            ("Mostly Inbound", "Mostly Inbound"),
                            ("Heavy Inbound", "Heavy Inbound"),
                        ],
                        default="Not Disclosed",
                        max_length=45,
                    ),
                ),
                (
                    "info_scope",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("", "Not Disclosed"),
                            ("Not Disclosed", "Not Disclosed"),
                            ("Regional", "Regional"),
                            ("North America", "North America"),
                            ("Asia Pacific", "Asia Pacific"),
                            ("Europe", "Europe"),
                            ("South America", "South America"),
                            ("Africa", "Africa"),
                            ("Australia", "Australia"),
                            ("Middle East", "Middle East"),
                            ("Global", "Global"),
                        ],
                        default="Not Disclosed",
                        max_length=39,
                    ),
                ),
                (
                    "info_type",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("", "Not Disclosed"),
                            ("Not Disclosed", "Not Disclosed"),
                            ("NSP", "NSP"),
                            ("Content", "Content"),
                            ("Cable/DSL/ISP", "Cable/DSL/ISP"),
                            ("Enterprise", "Enterprise"),
                            ("Educational/Research", "Educational/Research"),
                            ("Non-Profit", "Non-Profit"),
                            ("Route Server", "Route Server"),
                        ],
                        default="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=[
                            ("Open", "Open"),
                            ("Selective", "Selective"),
                            ("Restrictive", "Restrictive"),
                            ("No", "No"),
                        ],
                        max_length=72,
                    ),
                ),
                (
                    "policy_locations",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("Not Required", "Not Required"),
                            ("Preferred", "Preferred"),
                            ("Required - US", "Required - US"),
                            ("Required - EU", "Required - EU"),
                            ("Required - International",
                             "Required - International"),
                        ],
                        max_length=72,
                    ),
                ),
                ("policy_ratio", models.BooleanField(default=False)),
                (
                    "policy_contracts",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("Not Required", "Not Required"),
                            ("Private Only", "Private Only"),
                            ("Required", "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=[
                            ("Abuse", "Abuse"),
                            ("Maintenance", "Maintenance"),
                            ("Policy", "Policy"),
                            ("Technical", "Technical"),
                            ("NOC", "NOC"),
                            ("Public Relations", "Public Relations"),
                            ("Sales", "Sales"),
                        ],
                        max_length=27,
                    ),
                ),
                (
                    "visible",
                    models.CharField(
                        choices=[
                            ("Private", "Private"),
                            ("Users", "Users"),
                            ("Public", "Public"),
                        ],
                        default="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),
                ),
                (
                    "net",
                    models.ForeignKey(
                        default=0,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="poc_set",
                        to="django_peeringdb.Network",
                    ),
                ),
            ],
            options={
                "abstract": False,
                "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)),
                (
                    "fac",
                    models.ForeignKey(
                        default=0,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="netfac_set",
                        to="django_peeringdb.Facility",
                    ),
                ),
                (
                    "net",
                    models.ForeignKey(
                        default=0,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="netfac_set",
                        to="django_peeringdb.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="django_peeringdb.IXLan",
                    ),
                ),
                (
                    "net",
                    models.ForeignKey(
                        default=0,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="netixlan_set",
                        to="django_peeringdb.Network",
                    ),
                ),
            ],
            options={
                "abstract": False,
                "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),
                ),
                (
                    "latitude",
                    models.DecimalField(
                        blank=True,
                        decimal_places=6,
                        help_text="Latitude",
                        max_digits=9,
                        null=True,
                    ),
                ),
                (
                    "longitude",
                    models.DecimalField(
                        blank=True,
                        decimal_places=6,
                        help_text="Longitude",
                        max_digits=9,
                        null=True,
                    ),
                ),
                ("name", models.CharField(max_length=255, unique=True)),
                (
                    "website",
                    django_peeringdb.models.abstract.URLField(blank=True,
                                                              max_length=255),
                ),
                ("notes", models.TextField(blank=True)),
            ],
            options={
                "abstract": False,
                "db_table": "peeringdb_organization",
                "verbose_name_plural": "Organizations",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.AddField(
            model_name="network",
            name="org",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="net_set",
                to="django_peeringdb.Organization",
            ),
        ),
        migrations.AddField(
            model_name="internetexchange",
            name="org",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="ix_set",
                to="django_peeringdb.Organization",
            ),
        ),
        migrations.AddField(
            model_name="facility",
            name="org",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="fac_set",
                to="django_peeringdb.Organization",
            ),
        ),
        migrations.AlterUniqueTogether(
            name="networkfacility",
            unique_together={("net", "fac", "local_asn")},
        ),
        migrations.AlterUniqueTogether(
            name="internetexchangefacility",
            unique_together={("ix", "fac")},
        ),
    ]
Exemplo n.º 8
0
class Migration(migrations.Migration):

    dependencies = [
        ("peeringdb_server", "0039_delete_duplicateipnetworkixlan"),
    ]

    operations = [
        migrations.CreateModel(
            name="IXFMemberData",
            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()),
                ("operational", models.BooleanField(default=True)),
                (
                    "data",
                    models.TextField(
                        default="{}",
                        help_text=
                        "JSON snapshot of the ix-f member data that created this entry",
                    ),
                ),
                (
                    "log",
                    models.TextField(blank=True,
                                     help_text="Activity for this entry"),
                ),
                (
                    "dismissed",
                    models.BooleanField(
                        default=False,
                        help_text=
                        "Network's dismissal of this proposed change, which will hide it until from the customer facing network view",
                    ),
                ),
                (
                    "error",
                    models.TextField(
                        blank=True,
                        help_text=
                        "Trying to apply data to peeringdb raised an issue",
                        null=True,
                    ),
                ),
                ("reason", models.CharField(default="", max_length=255)),
                ("fetched", models.DateTimeField(verbose_name="Last Fetched")),
                (
                    "ixlan",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ixf_set",
                        to="peeringdb_server.IXLan",
                    ),
                ),
            ],
            options={
                "verbose_name": "IXF Member Data",
                "verbose_name_plural": "IXF Member Data",
                "db_table": "peeringdb_ixf_member_data",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
    ]
Exemplo n.º 9
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="Organization",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                ("name", models.CharField(max_length=255)),
                ("slug", models.CharField(max_length=64, unique=True)),
                ("personal", models.BooleanField(default=False)),
                (
                    "backend",
                    models.CharField(
                        blank=True,
                        help_text=
                        "Authentication service that created this org",
                        max_length=255,
                        null=True,
                    ),
                ),
                (
                    "remote_id",
                    models.PositiveIntegerField(
                        blank=True,
                        help_text=
                        "If the authentication service is in control of the organizations this field will hold a reference to the id at the auth service",
                        null=True,
                        unique=True,
                    ),
                ),
            ],
            options={
                "db_table": "fullctl_org",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name="OrganizationUser",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                (
                    "org",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="user_set",
                        to="django_fullctl.Organization",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="org_set",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "Organization Users",
                "db_table": "fullctl_org_user",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name="Instance",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                (
                    "secret",
                    models.CharField(
                        default=fullctl.django.models.concrete.account.
                        generate_secret,
                        max_length=255,
                    ),
                ),
                (
                    "org",
                    models.ForeignKey(
                        help_text="owned by org",
                        on_delete=django.db.models.deletion.CASCADE,
                        to="django_fullctl.Organization",
                    ),
                ),
            ],
            options={
                "db_table": "fullctl_instance",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name="APIKey",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                ("key", models.CharField(max_length=255, unique=True)),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="key_set",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "API Key",
                "verbose_name_plural": "API Keys",
                "db_table": "fullctl_apikey",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
    ]
Exemplo n.º 10
0
class Migration(migrations.Migration):

    dependencies = [
        ("applications", "0002_auto_20210209_1251"),
    ]

    operations = [
        migrations.RenameField(
            model_name="service",
            old_name="usage_url",
            new_name="api_url",
        ),
        migrations.CreateModel(
            name="ServiceAPIEndpoint",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "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)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("ok", "Ok"),
                            ("pending", "Pending"),
                            ("deactivated", "Deactivated"),
                            ("failed", "Failed"),
                            ("expired", "Expired"),
                        ],
                        default="ok",
                        max_length=12,
                    ),
                ),
                ("name", models.CharField(max_length=24)),
                ("path", models.CharField(max_length=255)),
                (
                    "svcapp",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="api_endpoint_set",
                        to="applications.Service",
                    ),
                ),
            ],
            options={
                "verbose_name": "API Endpoint",
                "verbose_name_plural": "API Endpoints",
                "db_table": "applications_service_api_endpoint",
            },
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
    ]