# Generated by Django 3.1.2 on 2020-11-16 16:44

import django.core.validators
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models

import djstripe.enums
import djstripe.fields
import djstripe.models.api


class Migration(migrations.Migration):
    dependencies = [("djstripe", "0001_initial")]

    operations = [
        migrations.AlterField(
            model_name="account",
            name="payouts_enabled",
            field=models.BooleanField(
                help_text="Whether Stripe can send payouts to this account", null=True
            ),
        ),
        migrations.AlterField(
            model_name="djstripepaymentmethod",
            name="type",
            field=models.CharField(db_index=True, max_length=50),
        ),
        migrations.AlterField(
            model_name="fileupload",
            name="purpose",
            field=djstripe.fields.StripeEnumField(
                enum=djstripe.enums.FilePurpose,
                help_text="The purpose of the uploaded file.",
                max_length=35,
            ),
        ),
        migrations.AddField(
            model_name="balancetransaction",
            name="reporting_category",
            field=djstripe.fields.StripeEnumField(
                default="",
                enum=djstripe.enums.BalanceTransactionReportingCategory,
                help_text="More information: https://stripe.com/docs/reports/reporting-categories",
                max_length=29,
            ),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name="balancetransaction",
            name="source",
            field=djstripe.fields.StripeIdField(default="", max_length=255),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name="applicationfee",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="applicationfeerefund",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="balancetransaction",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="bankaccount",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="card",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="charge",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="countryspec",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="coupon",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="customer",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="dispute",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="event",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="fileupload",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="invoice",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="invoiceitem",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="paymentintent",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="paymentmethod",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="payout",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="plan",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="product",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="refund",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="scheduledqueryrun",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="session",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="setupintent",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="source",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="subscription",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="subscriptionitem",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="taxrate",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="transfer",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="transferreversal",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="upcominginvoice",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="usagerecord",
            name="djstripe_owner_account",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The Stripe Account this object belongs to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AlterField(
            model_name="paymentintent",
            name="on_behalf_of",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The account (if any) for which the funds of the PaymentIntent are intended.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="payment_intents",
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AlterField(
            model_name="setupintent",
            name="on_behalf_of",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The account (if any) for which the setup is intended.",
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="setup_intents",
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.RemoveField(
            model_name="subscription",
            name="start",
        ),
        migrations.AlterUniqueTogether(
            name="customer",
            unique_together={("subscriber", "livemode", "djstripe_owner_account")},
        ),
        migrations.AddField(
            model_name="subscription",
            name="cancel_at",
            field=djstripe.fields.StripeDateTimeField(
                blank=True,
                help_text="A date in the future at which the subscription will automatically get canceled.",
                null=True,
            ),
        ),
        migrations.AlterField(
            model_name="customer",
            name="balance",
            field=djstripe.fields.StripeQuantumCurrencyAmountField(
                default=0,
                help_text="Current balance (in cents), if any, being stored on the customer's account. If negative, the customer has credit to apply to the next invoice. If positive, the customer has an amount owed that will be added to the next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account for recurring billing purposes (i.e., subscriptions, invoices, invoice items).",
            ),
        ),
        migrations.AlterField(
            model_name="customer",
            name="delinquent",
            field=models.BooleanField(
                default=False,
                help_text="Whether or not the latest charge for the customer's latest invoice has failed.",
            ),
        ),
        migrations.RemoveField(
            model_name="account",
            name="branding_icon",
        ),
        migrations.RemoveField(
            model_name="account",
            name="branding_logo",
        ),
        migrations.AlterField(
            model_name="bankaccount",
            name="account_holder_name",
            field=models.TextField(
                blank=True,
                help_text="The name of the person or business that owns the bank account.",
                max_length=5000,
            ),
        ),
        migrations.CreateModel(
            name="Price",
            fields=[
                (
                    "djstripe_id",
                    models.BigAutoField(
                        primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("id", djstripe.fields.StripeIdField(max_length=255, unique=True)),
                (
                    "livemode",
                    models.BooleanField(
                        blank=True,
                        default=None,
                        help_text="Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.",
                        null=True,
                    ),
                ),
                (
                    "created",
                    djstripe.fields.StripeDateTimeField(
                        blank=True,
                        help_text="The datetime this object was created in stripe.",
                        null=True,
                    ),
                ),
                (
                    "metadata",
                    djstripe.fields.JSONField(
                        blank=True,
                        help_text="A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.",
                        null=True,
                    ),
                ),
                (
                    "description",
                    models.TextField(
                        blank=True, help_text="A description of this object.", null=True
                    ),
                ),
                ("djstripe_created", models.DateTimeField(auto_now_add=True)),
                ("djstripe_updated", models.DateTimeField(auto_now=True)),
                (
                    "active",
                    models.BooleanField(
                        help_text="Whether the price can be used for new purchases."
                    ),
                ),
                (
                    "currency",
                    djstripe.fields.StripeCurrencyCodeField(
                        help_text="Three-letter ISO currency code", max_length=3
                    ),
                ),
                (
                    "nickname",
                    models.CharField(
                        blank=True,
                        help_text="A brief description of the plan, hidden from customers.",
                        max_length=250,
                    ),
                ),
                (
                    "recurring",
                    djstripe.fields.JSONField(
                        blank=True,
                        default=None,
                        help_text="The recurring components of a price such as `interval` and `usage_type`.",
                        null=True,
                    ),
                ),
                (
                    "type",
                    djstripe.fields.StripeEnumField(
                        enum=djstripe.enums.PriceType,
                        help_text="Whether the price is for a one-time purchase or a recurring (subscription) purchase.",
                        max_length=9,
                    ),
                ),
                (
                    "unit_amount",
                    djstripe.fields.StripeQuantumCurrencyAmountField(
                        blank=True,
                        help_text="The unit amount in cents to be charged, represented as a whole integer if possible. Null if a sub-cent precision is required.",
                        null=True,
                    ),
                ),
                (
                    "unit_amount_decimal",
                    djstripe.fields.StripeDecimalCurrencyAmountField(
                        blank=True,
                        decimal_places=12,
                        help_text="The unit amount in cents to be charged, represented as a decimal string with at most 12 decimal places.",
                        max_digits=19,
                        null=True,
                    ),
                ),
                (
                    "billing_scheme",
                    djstripe.fields.StripeEnumField(
                        blank=True,
                        enum=djstripe.enums.BillingScheme,
                        help_text="Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes.",
                        max_length=8,
                    ),
                ),
                (
                    "tiers",
                    djstripe.fields.JSONField(
                        blank=True,
                        help_text="Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`.",
                        null=True,
                    ),
                ),
                (
                    "tiers_mode",
                    djstripe.fields.StripeEnumField(
                        blank=True,
                        enum=djstripe.enums.PriceTiersMode,
                        help_text="Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows.",
                        max_length=9,
                        null=True,
                    ),
                ),
                (
                    "djstripe_owner_account",
                    djstripe.fields.StripeForeignKey(
                        blank=True,
                        help_text="The Stripe Account this object belongs to.",
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="djstripe.account",
                        to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
                    ),
                ),
                (
                    "product",
                    djstripe.fields.StripeForeignKey(
                        help_text="The product this price is associated with.",
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="prices",
                        to="djstripe.product",
                        to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
                    ),
                ),
                (
                    "lookup_key",
                    models.CharField(
                        blank=True,
                        help_text="A lookup key used to retrieve prices dynamically from a static string.",
                        max_length=250,
                        null=True,
                    ),
                ),
                (
                    "transform_quantity",
                    djstripe.fields.JSONField(
                        blank=True,
                        help_text="Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with `tiers`.",
                        null=True,
                    ),
                ),
            ],
            options={
                "get_latest_by": "created",
                "abstract": False,
                "ordering": ["unit_amount"],
            },
        ),
        # Oddly, this is repeated. Django bug?
        migrations.AlterModelOptions(
            name="price",
            options={"ordering": ["unit_amount"]},
        ),
        migrations.AddField(
            model_name="subscriptionitem",
            name="price",
            field=models.ForeignKey(
                blank=True,
                help_text="The price the customer is subscribed to.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="subscription_items",
                to="djstripe.price",
            ),
        ),
        migrations.CreateModel(
            name="TaxId",
            fields=[
                (
                    "djstripe_id",
                    models.BigAutoField(
                        primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("id", djstripe.fields.StripeIdField(max_length=255, unique=True)),
                (
                    "livemode",
                    models.BooleanField(
                        blank=True,
                        default=None,
                        help_text="Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.",
                        null=True,
                    ),
                ),
                (
                    "created",
                    djstripe.fields.StripeDateTimeField(
                        blank=True,
                        help_text="The datetime this object was created in stripe.",
                        null=True,
                    ),
                ),
                ("djstripe_created", models.DateTimeField(auto_now_add=True)),
                ("djstripe_updated", models.DateTimeField(auto_now=True)),
                (
                    "country",
                    models.CharField(
                        help_text="Two-letter ISO code representing the country of the tax ID.",
                        max_length=2,
                    ),
                ),
                (
                    "type",
                    djstripe.fields.StripeEnumField(
                        enum=djstripe.enums.TaxIdType,
                        help_text="The status of this subscription.",
                        max_length=7,
                    ),
                ),
                (
                    "value",
                    models.CharField(help_text="Value of the tax ID.", max_length=50),
                ),
                (
                    "verification",
                    djstripe.fields.JSONField(
                        help_text="Tax ID verification information."
                    ),
                ),
                (
                    "customer",
                    djstripe.fields.StripeForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="tax_ids",
                        to="djstripe.customer",
                        to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
                    ),
                ),
                (
                    "djstripe_owner_account",
                    djstripe.fields.StripeForeignKey(
                        blank=True,
                        help_text="The Stripe Account this object belongs to.",
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="djstripe.account",
                        to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
                    ),
                ),
            ],
            options={
                "verbose_name": "Tax ID",
                "verbose_name_plural": "Tax IDs",
            },
        ),
        migrations.RemoveField(
            model_name="customer",
            name="business_vat_id",
        ),
        migrations.AddField(
            model_name="invoiceitem",
            name="unit_amount",
            field=djstripe.fields.StripeQuantumCurrencyAmountField(
                blank=True,
                help_text="Unit amount (in the `currency` specified) of the invoice item.",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="invoiceitem",
            name="unit_amount_decimal",
            field=djstripe.fields.StripeDecimalCurrencyAmountField(
                blank=True,
                decimal_places=12,
                help_text="Same as `unit_amount`, but contains a decimal value with at most 12 decimal places.",
                max_digits=19,
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="invoiceitem",
            name="price",
            field=models.ForeignKey(
                help_text="If the invoice item is a proration, the price of the subscription for which the proration was computed.",
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="invoiceitems",
                to="djstripe.price",
            ),
        ),
        migrations.AlterField(
            model_name="invoiceitem",
            name="plan",
            field=models.ForeignKey(
                help_text="If the invoice item is a proration, the plan of the subscription for which the proration was computed.",
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to="djstripe.plan",
            ),
        ),
        migrations.CreateModel(
            name="SubscriptionSchedule",
            fields=[
                (
                    "djstripe_id",
                    models.BigAutoField(
                        primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("id", djstripe.fields.StripeIdField(max_length=255, unique=True)),
                (
                    "livemode",
                    models.BooleanField(
                        blank=True,
                        default=None,
                        help_text="Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.",
                        null=True,
                    ),
                ),
                (
                    "created",
                    djstripe.fields.StripeDateTimeField(
                        blank=True,
                        help_text="The datetime this object was created in stripe.",
                        null=True,
                    ),
                ),
                (
                    "metadata",
                    djstripe.fields.JSONField(
                        blank=True,
                        help_text="A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.",
                        null=True,
                    ),
                ),
                (
                    "description",
                    models.TextField(
                        blank=True, help_text="A description of this object.", null=True
                    ),
                ),
                ("djstripe_created", models.DateTimeField(auto_now_add=True)),
                ("djstripe_updated", models.DateTimeField(auto_now=True)),
                (
                    "canceled_at",
                    djstripe.fields.StripeDateTimeField(
                        blank=True,
                        help_text="Time at which the subscription schedule was canceled.",
                        null=True,
                    ),
                ),
                (
                    "completed_at",
                    djstripe.fields.StripeDateTimeField(
                        blank=True,
                        help_text="Time at which the subscription schedule was completed.",
                        null=True,
                    ),
                ),
                (
                    "current_phase",
                    djstripe.fields.JSONField(
                        blank=True,
                        help_text="Object representing the start and end dates for the current phase of the subscription schedule, if it is `active`.",
                        null=True,
                    ),
                ),
                (
                    "default_settings",
                    djstripe.fields.JSONField(
                        blank=True,
                        help_text="Object representing the subscription schedule's default settings.",
                        null=True,
                    ),
                ),
                (
                    "end_behavior",
                    djstripe.fields.StripeEnumField(
                        enum=djstripe.enums.SubscriptionScheduleEndBehavior,
                        help_text="Behavior of the subscription schedule and underlying subscription when it ends.",
                        max_length=7,
                    ),
                ),
                (
                    "phases",
                    djstripe.fields.JSONField(
                        blank=True,
                        help_text="Configuration for the subscription schedule's phases.",
                        null=True,
                    ),
                ),
                (
                    "released_at",
                    djstripe.fields.StripeDateTimeField(
                        blank=True,
                        help_text="Time at which the subscription schedule was released.",
                        null=True,
                    ),
                ),
                (
                    "status",
                    djstripe.fields.StripeEnumField(
                        enum=djstripe.enums.SubscriptionScheduleStatus,
                        help_text="The present status of the subscription schedule. Possible values are `not_started`, `active`, `completed`, `released`, and `canceled`.",
                        max_length=11,
                    ),
                ),
                (
                    "customer",
                    models.ForeignKey(
                        help_text="The customer who owns the subscription schedule.",
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="schedules",
                        to="djstripe.customer",
                    ),
                ),
                (
                    "djstripe_owner_account",
                    djstripe.fields.StripeForeignKey(
                        blank=True,
                        help_text="The Stripe Account this object belongs to.",
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="djstripe.account",
                        to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
                    ),
                ),
                (
                    "released_subscription",
                    models.ForeignKey(
                        blank=True,
                        help_text="The subscription once managed by this subscription schedule (if it is released).",
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="released_schedules",
                        to="djstripe.subscription",
                    ),
                ),
                (
                    "billing_thresholds",
                    djstripe.fields.JSONField(
                        blank=True,
                        help_text="Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period.",
                        null=True,
                    ),
                ),
            ],
            options={
                "get_latest_by": "created",
                "abstract": False,
            },
        ),
        migrations.AddField(
            model_name="subscription",
            name="schedule",
            field=models.ForeignKey(
                blank=True,
                help_text="The schedule associated with this subscription.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="subscriptions",
                to="djstripe.subscriptionschedule",
            ),
        ),
        migrations.AddField(
            model_name="payout",
            name="automatic",
            field=models.BooleanField(
                default=False,
                help_text="`true` if the payout was created by an automated payout schedule, and `false` if it was requested manually.",
            ),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name="payout",
            name="source_type",
            field=djstripe.fields.StripeEnumField(
                default="bank_account",
                enum=djstripe.enums.PayoutSourceType,
                help_text="The source balance this payout came from.",
                max_length=12,
            ),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name="payout",
            name="failure_balance_transaction",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="If the payout failed or was canceled, this will be the balance transaction that reversed the initial balance transaction, and puts the funds from the failed payout back in your balance.",
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="failure_payouts",
                to="djstripe.balancetransaction",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.RenameField(
            model_name="charge",
            old_name="account",
            new_name="on_behalf_of",
        ),
        migrations.AddField(
            model_name="charge",
            name="amount_captured",
            field=djstripe.fields.StripeDecimalCurrencyAmountField(
                decimal_places=2,
                help_text="Amount (as decimal) captured (can be less than the amount attribute on the charge if a partial capture was issued).",
                max_digits=11,
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="charge",
            name="application",
            field=models.CharField(
                blank=True,
                help_text="ID of the Connect application that created the charge.",
                max_length=255,
            ),
        ),
        migrations.AddField(
            model_name="charge",
            name="application_fee_amount",
            field=djstripe.fields.StripeDecimalCurrencyAmountField(
                blank=True,
                decimal_places=2,
                help_text="The amount (as decimal) of the application fee (if any) requested for the charge.",
                max_digits=11,
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="charge",
            name="billing_details",
            field=djstripe.fields.JSONField(
                help_text="Billing information associated with the PaymentMethod at the time of the transaction.",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="charge",
            name="calculated_statement_descriptor",
            field=models.CharField(
                default="",
                help_text="The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined.",
                max_length=22,
            ),
        ),
        migrations.AddField(
            model_name="charge",
            name="disputed",
            field=models.BooleanField(
                default=False, help_text="Whether the charge has been disputed."
            ),
        ),
        migrations.AddField(
            model_name="charge",
            name="source_transfer",
            field=djstripe.fields.StripeForeignKey(
                help_text="The transfer which created this charge. Only present if the charge came from another Stripe account.",
                null=True,
                blank=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="+",
                to="djstripe.transfer",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="charge",
            name="statement_descriptor_suffix",
            field=models.CharField(
                blank=True,
                help_text="Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.",
                max_length=22,
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="charge",
            name="transfer_data",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="An optional dictionary including the account to automatically transfer to as part of a destination charge.",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="subscription",
            name="billing_thresholds",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period.",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="subscriptionitem",
            name="billing_thresholds",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period.",
                null=True,
            ),
        ),
        migrations.AlterField(
            model_name="charge",
            name="statement_descriptor",
            field=models.CharField(
                blank=True,
                help_text="For card charges, use statement_descriptor_suffix instead. Otherwise, you can use this value as the complete description of a charge on your customers' statements. Must contain at least one letter, maximum 22 characters.",
                max_length=22,
                null=True,
            ),
        ),
        migrations.AlterField(
            model_name="charge",
            name="transfer",
            field=djstripe.fields.StripeForeignKey(
                help_text="The transfer to the `destination` account (only applicable if the charge was created using the `destination` parameter).",
                null=True,
                blank=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="djstripe.transfer",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AlterField(
            model_name="charge",
            name="transfer_group",
            field=models.CharField(
                blank=True,
                help_text="A string that identifies this transaction as part of a group.",
                max_length=255,
                null=True,
            ),
        ),
        migrations.AlterField(
            model_name="charge",
            name="on_behalf_of",
            field=djstripe.fields.StripeForeignKey(
                help_text="The account (if any) the charge was made on behalf of without triggering an automatic transfer.",
                null=True,
                blank=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="charges",
                to="djstripe.account",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AddField(
            model_name="charge",
            name="application_fee",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The application fee (if any) for the charge.",
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="fee_for_charge",
                to="djstripe.applicationfee",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.RemoveField(
            model_name="plan",
            name="name",
        ),
        migrations.RemoveField(
            model_name="plan",
            name="statement_descriptor",
        ),
        migrations.AddField(
            model_name="plan",
            name="amount_decimal",
            field=djstripe.fields.StripeDecimalCurrencyAmountField(
                blank=True,
                decimal_places=12,
                help_text="The unit amount in cents to be charged, represented as a decimal string with at most 12 decimal places.",
                max_digits=19,
                null=True,
            ),
        ),
        migrations.AlterField(
            model_name="plan",
            name="active",
            field=models.BooleanField(
                help_text="Whether the plan can be used for new purchases."
            ),
        ),
        migrations.AlterField(
            model_name="plan",
            name="interval_count",
            field=models.PositiveIntegerField(
                blank=True,
                help_text="The number of intervals (specified in the interval property) between each subscription billing.",
                null=True,
            ),
        ),
        migrations.AlterField(
            model_name="plan",
            name="product",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="The product whose pricing this plan determines.",
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to="djstripe.product",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AlterField(
            model_name="plan",
            name="trial_period_days",
            field=models.IntegerField(
                blank=True,
                help_text="Number of trial period days granted when subscribing a customer to this plan. Null if the plan has no trial period.",
                null=True,
            ),
        ),
        migrations.CreateModel(
            name="APIKey",
            fields=[
                (
                    "djstripe_id",
                    models.BigAutoField(
                        primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                (
                    "livemode",
                    models.BooleanField(
                        help_text="Whether the key is valid for live or test mode."
                    ),
                ),
                (
                    "created",
                    djstripe.fields.StripeDateTimeField(
                        blank=True,
                        help_text="The datetime this object was created in stripe.",
                        null=True,
                    ),
                ),
                ("djstripe_created", models.DateTimeField(auto_now_add=True)),
                ("djstripe_updated", models.DateTimeField(auto_now=True)),
                (
                    "id",
                    models.CharField(
                        default=djstripe.models.api.generate_api_key_id,
                        editable=False,
                        max_length=255,
                    ),
                ),
                (
                    "type",
                    djstripe.fields.StripeEnumField(
                        enum=djstripe.enums.APIKeyType, max_length=11
                    ),
                ),
                (
                    "name",
                    models.CharField(
                        blank=True,
                        help_text="An optional name to identify the key.",
                        max_length=100,
                        verbose_name="Key name",
                    ),
                ),
                (
                    "secret",
                    models.CharField(
                        help_text="The value of the key.",
                        max_length=128,
                        unique=True,
                        validators=[
                            django.core.validators.RegexValidator(
                                regex="^(pk|sk|rk)_(test|live)_([a-zA-Z0-9]{24,99})"
                            )
                        ],
                    ),
                ),
                (
                    "djstripe_owner_account",
                    djstripe.fields.StripeForeignKey(
                        blank=True,
                        help_text="The Stripe Account this object belongs to.",
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="djstripe.account",
                        to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
                    ),
                ),
            ],
            options={
                "get_latest_by": "created",
                "abstract": False,
            },
        ),
        migrations.RemoveField(
            model_name="paymentmethod",
            name="description",
        ),
        migrations.AddField(
            model_name="paymentmethod",
            name="alipay",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="Additional information for payment methods of type `alipay`",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="paymentmethod",
            name="au_becs_debit",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="Additional information for payment methods of type `au_becs_debit`",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="paymentmethod",
            name="bacs_debit",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="Additional information for payment methods of type `bacs_debit`",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="paymentmethod",
            name="bancontact",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="Additional information for payment methods of type `bancontact`",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="paymentmethod",
            name="eps",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="Additional information for payment methods of type `eps`",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="paymentmethod",
            name="fpx",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="Additional information for payment methods of type `fpx`",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="paymentmethod",
            name="giropay",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="Additional information for payment methods of type `giropay`",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="paymentmethod",
            name="ideal",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="Additional information for payment methods of type `ideal`",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="paymentmethod",
            name="interac_present",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="Additional information for payment methods of type `interac_present`",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="paymentmethod",
            name="oxxo",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="Additional information for payment methods of type `oxxo`",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="paymentmethod",
            name="p24",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="Additional information for payment methods of type `p24`",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="paymentmethod",
            name="sepa_debit",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="Additional information for payment methods of type `sepa_debit`",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="paymentmethod",
            name="sofort",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="Additional information for payment methods of type `sofort`",
                null=True,
            ),
        ),
        migrations.AlterField(
            model_name="paymentmethod",
            name="card",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="Additional information for payment methods of type `card`",
                null=True,
            ),
        ),
        migrations.AlterField(
            model_name="paymentmethod",
            name="card_present",
            field=djstripe.fields.JSONField(
                blank=True,
                help_text="Additional information for payment methods of type `card_present`",
                null=True,
            ),
        ),
        migrations.AlterField(
            model_name="paymentmethod",
            name="customer",
            field=djstripe.fields.StripeForeignKey(
                blank=True,
                help_text="Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer.",
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="payment_methods",
                to="djstripe.customer",
                to_field=settings.DJSTRIPE_FOREIGN_KEY_TO_FIELD,
            ),
        ),
        migrations.AlterField(
            model_name="paymentmethod",
            name="type",
            field=djstripe.fields.StripeEnumField(
                enum=djstripe.enums.PaymentMethodType,
                help_text="The type of the PaymentMethod.",
                max_length=15,
            ),
        ),
    ]
